Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BufferPool = sync.Pool{ New: func() any { return bytes.NewBuffer(make([]byte, 4*1024)) }, }
BufferPool for io.CopyBuffer
Functions ¶
func HandleClose ¶ added in v0.0.5
HandleClose call properly
Types ¶
type Item ¶
type Item struct {
Date time.Time `json:"date"`
ID string `json:"id"`
Name string `json:"name"`
Pathname string `json:"pathname"`
Extension string `json:"extension"`
IsDir bool `json:"isDir"`
Size int64 `json:"size"`
}
Item describe item on a storage provider
type Storage ¶
type Storage interface {
Enabled() bool
Name() string
WithIgnoreFn(ignoreFn func(Item) bool) Storage
Path(pathname string) string
Info(ctx context.Context, pathname string) (Item, error)
List(ctx context.Context, pathname string) ([]Item, error)
WriteTo(ctx context.Context, pathname string, reader io.Reader) error
ReadFrom(ctx context.Context, pathname string) (io.ReadSeekCloser, error)
Walk(ctx context.Context, pathname string, walkFn func(Item) error) error
CreateDir(ctx context.Context, pathname string) error
Rename(ctx context.Context, oldName, newName string) error
Remove(ctx context.Context, pathname string) error
UpdateDate(ctx context.Context, pathname string, date time.Time) error
ConvertError(err error) error
}
Storage describe action on a storage provider
Click to show internal directories.
Click to hide internal directories.