Documentation
¶
Index ¶
- Constants
- Variables
- func Initialize(cfg Config, logger zerolog.Logger) error
- func InsertBackend(d db.Handler, name string, driver Driver, params map[string]string) error
- func ListBackends() map[string]Backend
- func Migrate(name string, dryRun bool) error
- type Backend
- type Config
- type Driver
- type LocalBackend
- type MountConfig
- type WrittenFile
Constants ¶
View Source
const DefaultBackendName = "_"
Variables ¶
View Source
var Root string
Functions ¶
func InsertBackend ¶
func ListBackends ¶
Types ¶
type Backend ¶
type Backend interface {
Name() string
OpenRead(name string, start, length int) (io.ReadCloser, error)
Delete(name string) error
DeleteAll(names []string) []error
Copy(ctx context.Context, src Backend, srcName, destName string) error
}
func GetBackendByName ¶
type Config ¶
type Config struct {
Root string `koanf:"root"`
Temp string `koanf:"temp"`
Mounts map[string]MountConfig `koanf:"mounts"`
}
type Driver ¶
type Driver struct {
Name string
Description string
Params []string
Create func(name string, params map[string]string) (Backend, error)
}
func FindDriver ¶
func ListDrivers ¶
func ListDrivers() []Driver
type LocalBackend ¶
type LocalBackend interface {
Backend
Write(name string, contents io.Reader) (WrittenFile, error)
Path(name string) string
}
func DefaultBackend ¶
func DefaultBackend() LocalBackend
type MountConfig ¶
type WrittenFile ¶
type WrittenFile struct {
// contains filtered or unexported fields
}
func (WrittenFile) Delete ¶
func (w WrittenFile) Delete() error
func (WrittenFile) OpenRead ¶
func (w WrittenFile) OpenRead() (io.ReadSeekCloser, error)
func (WrittenFile) SHA256Sum ¶
func (w WrittenFile) SHA256Sum() string
func (WrittenFile) Size ¶
func (w WrittenFile) Size() int64
Click to show internal directories.
Click to hide internal directories.