Documentation
¶
Index ¶
Constants ¶
View Source
const (
GITType = Type("git")
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager interface {
// Init creates storage locally
Init(
ctx context.Context,
path string,
remote maybe.Maybe[string],
t Type,
) (Storage, error)
// Clone copies Storage from remote to path
Clone(ctx context.Context, path string, remote string, t Type) (Storage, error)
// Use local copy of store by path
Use(ctx context.Context, path string) (Storage, error)
// Remove local storage copy
Remove(ctx context.Context, path string) error
}
Manager manages stores: create, delete, mount
type Storage ¶
type Storage interface {
// Store data to storage
Store(ctx context.Context, path string, data []byte) error
// Remove path from storage
Remove(ctx context.Context, path string) error
// Copy path in storage
Copy(ctx context.Context, src, dst string) error
// Move path in storage
Move(ctx context.Context, src, dst string) error
// Get data from storage
Get(ctx context.Context, path string) (maybe.Maybe[[]byte], error)
// GetLatest reruns latest version of object
GetLatest(ctx context.Context, p string) (maybe.Maybe[[]byte], error)
// List storage entries
List(ctx context.Context, path string) (Tree, error)
// AddRemote to storage. remoteAddr depends on storage implementation
AddRemote(ctx context.Context, remoteName string, remoteAddr string) error
// HasRemote reports that Storage has remote
HasRemote(ctx context.Context) (bool, error)
// Push storage to remote if there is one
Push(ctx context.Context) error
// Pull changes from remote
Pull(ctx context.Context) error
// Commit changes to storage. Semantics depends on storage implementation
Commit(ctx context.Context, msg string) error
// Rollback all uncommitted changes
Rollback(ctx context.Context) error
}
Click to show internal directories.
Click to hide internal directories.