Little cleanup

pull/80/head
Aloïs Micard 4 years ago
parent 579a39dddf
commit 866b80f013
No known key found for this signature in database
GPG Key ID: 1A0EB82F071F5EFE

@ -40,6 +40,7 @@ func execute(ctx *cli.Context) error {
log.Info().
Str("ver", ctx.App.Version).
Str("hub-uri", ctx.String("hub-uri")).
Str("storage-dir", ctx.String("storage-dir")).
Msg("Starting tdsh-archiver")
// Create the subscriber

@ -14,6 +14,7 @@ type localStorage struct {
baseDir string
}
// NewLocalStorage returns a new Storage that use local file system
func NewLocalStorage(root string) (Storage, error) {
return &localStorage{baseDir: root}, nil
}
@ -38,10 +39,10 @@ func (s *localStorage) Store(url string, time time.Time, body []byte) error {
return nil
}
func formatPath(rawUrl string, time time.Time) (string, error) {
func formatPath(rawURL string, time time.Time) (string, error) {
b := strings.Builder{}
u, err := url.Parse(rawUrl)
u, err := url.Parse(rawURL)
if err != nil {
return "", err
}

@ -4,6 +4,8 @@ import "time"
//go:generate mockgen -destination=../storage_mock/storage_mock.go -package=storage_mock . Storage
// Storage is a abstraction layer where we store resource
type Storage interface {
// Store the resource
Store(url string, time time.Time, body []byte) error
}

Loading…
Cancel
Save