Documentation
¶
Index ¶
- Variables
- func Startup() (err error)
- type AzureStorage
- func (f *AzureStorage) Delete(name string) (err error)
- func (f *AzureStorage) Get(name string) (found bool, data io.ReadCloser, metadata map[string]string, err error)
- func (f *AzureStorage) GetMetadata(name string) (metadata map[string]string, err error)
- func (f *AzureStorage) Init() error
- func (f *AzureStorage) List() ([]FileInfo, error)
- func (f *AzureStorage) ListWithContext(ctx context.Context) ([]FileInfo, error)
- func (f *AzureStorage) Set(name string, in io.Reader, metadata map[string]string) (err error)
- func (f *AzureStorage) SetMetadata(name string, metadata map[string]string) error
- func (f *AzureStorage) SetWithContext(ctx context.Context, name string, in io.Reader, metadata map[string]string) (err error)
- type FileInfo
- type Fs
- type Local
- func (f *Local) Delete(name string) error
- func (f *Local) Get(name string) (found bool, data io.ReadCloser, metadata map[string]string, err error)
- func (f *Local) GetMetadata(name string) (metadata map[string]string, err error)
- func (f *Local) Init() error
- func (f *Local) List() ([]FileInfo, error)
- func (f *Local) ListWithContext(ctx context.Context) ([]FileInfo, error)
- func (f *Local) Set(name string, in io.Reader, metadata map[string]string) (err error)
- func (f *Local) SetMetadata(name string, metadata map[string]string) error
- func (f *Local) SetWithContext(ctx context.Context, name string, in io.Reader, metadata map[string]string) (err error)
- type S3
- func (f *S3) Delete(name string) (err error)
- func (f *S3) Get(name string) (found bool, data io.ReadCloser, metadata map[string]string, err error)
- func (f *S3) GetMetadata(name string) (metadata map[string]string, err error)
- func (f *S3) Init() error
- func (f *S3) List() ([]FileInfo, error)
- func (f *S3) ListWithContext(ctx context.Context) ([]FileInfo, error)
- func (f *S3) Set(name string, in io.Reader, metadata map[string]string) (err error)
- func (f *S3) SetMetadata(name string, metadata map[string]string) error
- func (f *S3) SetWithContext(ctx context.Context, name string, in io.Reader, metadata map[string]string) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNameEmptyInvalid = errors.New("name is empty or invalid") ErrConnStringInvalid = errors.New("invalid connection string") ErrExist = errors.New("file already exists") ErrNotExist = errors.New("file does not exist") )
Errors
Functions ¶
Types ¶
type AzureStorage ¶
type AzureStorage struct {
// contains filtered or unexported fields
}
AzureStorage stores files on Azure Blob Storage
func (*AzureStorage) Delete ¶
func (f *AzureStorage) Delete(name string) (err error)
func (*AzureStorage) Get ¶
func (f *AzureStorage) Get(name string) (found bool, data io.ReadCloser, metadata map[string]string, err error)
func (*AzureStorage) GetMetadata ¶
func (f *AzureStorage) GetMetadata(name string) (metadata map[string]string, err error)
func (*AzureStorage) Init ¶
func (f *AzureStorage) Init() error
func (*AzureStorage) List ¶
func (f *AzureStorage) List() ([]FileInfo, error)
func (*AzureStorage) ListWithContext ¶
func (f *AzureStorage) ListWithContext(ctx context.Context) ([]FileInfo, error)
func (*AzureStorage) SetMetadata ¶
func (f *AzureStorage) SetMetadata(name string, metadata map[string]string) error
type FileInfo ¶
type FileInfo struct {
Name string `json:"name"`
Size int64 `json:"size"`
LastModified time.Time `json:"lastModified"`
}
FileInfo object returned by the List methods
type Fs ¶
type Fs interface {
// Init the object
Init() error
// Get returns a stream to a file in the filesystem
Get(name string) (found bool, data io.ReadCloser, metadata map[string]string, err error)
// List returns the list of files in the filesystem
List() ([]FileInfo, error)
// ListWithContext is like List, but accepts a custom context object
ListWithContext(ctx context.Context) ([]FileInfo, error)
// Set writes a stream to the file in the filesystem
Set(name string, in io.Reader, metadata map[string]string) (err error)
// SetWithContext is like Set, but accepts a custom context object
SetWithContext(ctx context.Context, name string, in io.Reader, metadata map[string]string) (err error)
// GetMetadata returns the metadata for the file only
GetMetadata(name string) (metadata map[string]string, err error)
// SetMetadata updates a file's metadata in the filesystem
SetMetadata(name string, metadata map[string]string) error
// Delete a file from the filesystem
Delete(name string) (err error)
}
Fs is the interface for the filesystem
var Instance Fs
Singleton
type Local ¶
type Local struct {
// contains filtered or unexported fields
}
Local is the local file system
func (*Local) GetMetadata ¶
func (*Local) ListWithContext ¶
func (*Local) SetMetadata ¶
Click to show internal directories.
Click to hide internal directories.