Documentation
¶
Index ¶
- Variables
- func ValidKey(key string) error
- type FileSystem
- func (f *FileSystem) Delete(_ context.Context, key string) error
- func (f *FileSystem) Exists(ctx context.Context, key string) bool
- func (f *FileSystem) List(_ context.Context, prefix string) ([]Stat, error)
- func (f *FileSystem) Move(_ context.Context, from, to string) error
- func (f *FileSystem) Open(_ context.Context, key string) (io.ReadSeekCloser, error)
- func (f *FileSystem) Root() string
- func (f *FileSystem) Save(ctx context.Context, key string, r io.Reader) (Stat, error)
- func (f *FileSystem) Stat(_ context.Context, key string) (Stat, error)
- type Stat
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("coyote/storage: no such object") ErrBadKey = errors.New("coyote/storage: invalid key") )
Functions ¶
Types ¶
type FileSystem ¶
type FileSystem struct {
// contains filtered or unexported fields
}
func NewFileSystem ¶
func NewFileSystem(root string) *FileSystem
func (*FileSystem) Open ¶
func (f *FileSystem) Open(_ context.Context, key string) (io.ReadSeekCloser, error)
func (*FileSystem) Root ¶
func (f *FileSystem) Root() string
type Storage ¶
type Storage interface {
Save(ctx context.Context, key string, r io.Reader) (Stat, error)
Open(ctx context.Context, key string) (io.ReadSeekCloser, error)
Stat(ctx context.Context, key string) (Stat, error)
Delete(ctx context.Context, key string) error
Exists(ctx context.Context, key string) bool
Move(ctx context.Context, from, to string) error
List(ctx context.Context, prefix string) ([]Stat, error)
}
Click to show internal directories.
Click to hide internal directories.