Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CommonContentStoreOption ¶
type CommonContentStoreOption interface {
Apply(store *commonContentStore)
}
func WithPrefix ¶
func WithPrefix(dir string) CommonContentStoreOption
type Config ¶
type Config struct {
Local DriverConfig
S3 DriverConfig
}
type ContentStorage ¶
type ContentStorage interface {
Get(ctx context.Context, path string) ([]byte, error)
Open(ctx context.Context, path string) (io.ReadCloser, error)
Put(ctx context.Context, path string, contents []byte) error
Save(ctx context.Context, path string, r io.Reader, size int64) error
GetWriter(ctx context.Context, path string, append bool) (storagedriver.FileWriter, error)
Stat(ctx context.Context, path string) (storagedriver.FileInfo, error)
Delete(ctx context.Context, path string) error
List(ctx context.Context, path string) ([]string, error)
PrefixDir() string
}
func NewCommonContentStore ¶
func NewCommonContentStore(ctx context.Context, driver storagedriver.StorageDriver, opts ...CommonContentStoreOption) (ContentStorage, error)
type DriverConfig ¶
type DriverConfig struct {
Driver DriverType
Parameters map[string]interface{}
}
type DriverGetter ¶
type DriverGetter interface {
Get(ctx context.Context, provider DriverType, config Config) (driver.StorageDriver, error)
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.