Documentation ¶
Overview ¶
Package fs provides a storage implementation for the local filesystem
Index ¶
- type Config
- type Storage
- func (fs *Storage) Delete(ctx context.Context, path string) error
- func (fs *Storage) Open(ctx context.Context, path string) (io.ReadCloser, error)
- func (fs *Storage) OpenWithStat(ctx context.Context, path string) (io.ReadCloser, *storage.Stat, error)
- func (fs *Storage) Save(ctx context.Context, content io.Reader, path string) error
- func (fs *Storage) Stat(ctx context.Context, path string) (*storage.Stat, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Enabled is a flag to enable or disable the storage Enabled bool `json:"enabled" koanf:"enabled" default:"false"` // Root is the root directory for the filesystem storage Root string `json:"root" koanf:"root" default:"./storage"` }
Config is the configuration for Storage
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is a local filesystem storage interface
func NewStorage ¶
NewStorage returns a new filesystem storage with the provided configuration
func (*Storage) OpenWithStat ¶
func (fs *Storage) OpenWithStat(ctx context.Context, path string) (io.ReadCloser, *storage.Stat, error)
OpenWithStat opens path for reading with file stats
Click to show internal directories.
Click to hide internal directories.