Documentation
¶
Index ¶
- func MetadataToStringMap(metadata Metadata) map[string]*string
- type LocalStorage
- func (s *LocalStorage) Delete(ctx context.Context, filename string) error
- func (s *LocalStorage) FileNotExists(err error) bool
- func (s *LocalStorage) Get(ctx context.Context, filename string) (reader io.ReadCloser, err error)
- func (s *LocalStorage) GetOnlyMetadata(ctx context.Context, filename string) (metadata Metadata, err error)
- func (s *LocalStorage) GetWithMetadata(ctx context.Context, filename string) (reader io.ReadCloser, metadata Metadata, err error)
- func (s *LocalStorage) List(ctx context.Context) (filenames []string, metadata []Metadata, err error)
- func (s *LocalStorage) Put(ctx context.Context, filename string, reader io.Reader, metadata Metadata) error
- func (s *LocalStorage) Type() string
- type Metadata
- type S3Storage
- func (s *S3Storage) Delete(ctx context.Context, filename string) error
- func (s *S3Storage) FileNotExists(err error) bool
- func (s *S3Storage) Get(ctx context.Context, filename string) (reader io.ReadCloser, err error)
- func (s *S3Storage) GetOnlyMetadata(ctx context.Context, filename string) (metadata Metadata, err error)
- func (s *S3Storage) GetWithMetadata(ctx context.Context, filename string) (reader io.ReadCloser, metadata Metadata, err error)
- func (s *S3Storage) List(ctx context.Context) (filenames []string, metadata []Metadata, err error)
- func (s *S3Storage) Put(ctx context.Context, filename string, reader io.Reader, metadata Metadata) error
- func (s *S3Storage) Type() string
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MetadataToStringMap ¶
Types ¶
type LocalStorage ¶
type LocalStorage struct { Storage // contains filtered or unexported fields }
func NewLocalStorage ¶
func NewLocalStorage(basedir string) (*LocalStorage, error)
func (*LocalStorage) Delete ¶
func (s *LocalStorage) Delete(ctx context.Context, filename string) error
func (*LocalStorage) FileNotExists ¶
func (s *LocalStorage) FileNotExists(err error) bool
func (*LocalStorage) Get ¶
func (s *LocalStorage) Get(ctx context.Context, filename string) (reader io.ReadCloser, err error)
func (*LocalStorage) GetOnlyMetadata ¶ added in v0.4.0
func (*LocalStorage) GetWithMetadata ¶
func (s *LocalStorage) GetWithMetadata(ctx context.Context, filename string) (reader io.ReadCloser, metadata Metadata, err error)
func (*LocalStorage) Type ¶
func (s *LocalStorage) Type() string
type Metadata ¶
type Metadata struct { Filename string // Original filename ContentType string ContentLength string }
func StringMapToMetadata ¶
type S3Storage ¶
type S3Storage struct { Storage // contains filtered or unexported fields }
func NewS3Storage ¶
func (*S3Storage) FileNotExists ¶
func (*S3Storage) GetOnlyMetadata ¶ added in v0.4.0
func (*S3Storage) GetWithMetadata ¶
type Storage ¶
type Storage interface { List(ctx context.Context) (filenames []string, metadata []Metadata, err error) Get(ctx context.Context, filename string) (reader io.ReadCloser, err error) GetWithMetadata(ctx context.Context, filename string) (reader io.ReadCloser, metadata Metadata, err error) GetOnlyMetadata(ctx context.Context, filename string) (metadata Metadata, err error) Put(ctx context.Context, filename string, reader io.Reader, metadata Metadata) error Delete(ctx context.Context, filename string) error FileNotExists(err error) bool Type() string }
Click to show internal directories.
Click to hide internal directories.