Documentation
¶
Index ¶
Constants ¶
Variables ¶
View Source
var ( ErrNotEnabled = errors.New("not enabled") ErrRelativePath = errors.New("name contains relatives paths") ErrInvalidPath = errors.New("name is invalid") ErrDirExpected = errors.New("directory expected") ErrUnsupported = fmt.Errorf("not supported by the storage: %w", errors.ErrUnsupported) )
Functions ¶
func ErrNotExist ¶
func IsNotExist ¶
Types ¶
type Item ¶
type Item struct {
Date time.Time `json:"date" msg:"date"`
ID string `json:"id" msg:"id"`
NameValue string `json:"name" msg:"name"`
Pathname string `json:"pathname" msg:"pathname"`
Extension string `json:"extension" msg:"extension"`
SizeValue int64 `json:"size" msg:"size"`
FileMode os.FileMode `json:"fileMode" msg:"fileMode"`
IsDirValue bool `json:"isDir" msg:"isDir"`
}
type ReadAtSeekCloser ¶ added in v1.4.4
type ReadAtSeekCloser interface {
io.ReadSeekCloser
io.ReaderAt
}
type Storage ¶
type Storage interface {
Enabled() bool
Close() error
Path(string) string
Stat(ctx context.Context, name string) (Item, error)
Mkdir(ctx context.Context, name string) error
Rename(ctx context.Context, oldName, newName string) error
RemoveAll(ctx context.Context, name string) error
Name() string
WithIgnoreFn(func(Item) bool) Storage
List(ctx context.Context, name string) ([]Item, error)
WriteTo(ctx context.Context, name string, reader io.Reader, opts WriteOpts) error
ReadFrom(ctx context.Context, name string) (ReadAtSeekCloser, error)
Walk(ctx context.Context, name string, walkFn func(Item) error) error
UpdateDate(ctx context.Context, name string, date time.Time) error
ConvertError(err error) error
}
Click to show internal directories.
Click to hide internal directories.