Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func JoinPrefix ¶
func NormalizePath ¶
func RegisterDriver ¶
func RegisterDriver(name string, factory DriverFactory)
Types ¶
type ContextStorage ¶
type ContextStorage interface {
GetContext(ctx context.Context, p string) ([]byte, error)
PutContext(ctx context.Context, p string, contents []byte) error
DeleteContext(ctx context.Context, p string) error
StatContext(ctx context.Context, p string) (Entry, error)
ExistsContext(ctx context.Context, p string) (bool, error)
ListContext(ctx context.Context, p string) ([]Entry, error)
WalkContext(ctx context.Context, p string, fn func(Entry) error) error
CopyContext(ctx context.Context, src, dst string) error
MoveContext(ctx context.Context, src, dst string) error
URLContext(ctx context.Context, p string) (string, error)
}
type DriverFactory ¶
type DriverFactory func(ctx context.Context, cfg ResolvedConfig) (Storage, error)
func LookupDriver ¶
func LookupDriver(name string) (DriverFactory, bool)
type ResolvedConfig ¶
type ResolvedConfig struct {
Driver string
Remote string
Prefix string
RcloneConfigPath string
RcloneConfigData string
S3Bucket string
S3Endpoint string
S3Region string
S3AccessKeyID string
S3SecretAccessKey string
S3UsePathStyle bool
S3UnsignedPayload bool
SFTPHost string
SFTPPort int
SFTPUser string
SFTPPassword string
SFTPKeyPath string
SFTPKnownHostsPath string
SFTPInsecureIgnoreHostKey bool
FTPHost string
FTPPort int
FTPUser string
FTPPassword string
FTPTLS bool
FTPInsecureSkipVerify bool
DropboxToken string
GCSBucket string
GCSCredentialsJSON string
GCSEndpoint string
RedisAddr string
RedisUsername string
RedisPassword string
RedisDB int
}
type Storage ¶
type Storage interface {
Get(p string) ([]byte, error)
Put(p string, contents []byte) error
Delete(p string) error
Stat(p string) (Entry, error)
Exists(p string) (bool, error)
List(p string) ([]Entry, error)
Walk(p string, fn func(Entry) error) error
Copy(src, dst string) error
Move(src, dst string) error
URL(p string) (string, error)
}
Click to show internal directories.
Click to hide internal directories.