Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ImageExtensions contains extensions of Image ImageExtensions = map[string]bool{".jpg": true, ".jpeg": true, ".png": true, ".gif": true, ".svg": true, ".tiff": true} // PdfExtensions contains extensions of Pdf PdfExtensions = map[string]bool{".pdf": true} // VideoExtensions contains extensions of Video VideoExtensions = map[string]string{".mp4": "video/mp4", ".mov": "video/quicktime", ".avi": "video/x-msvideo"} )
Functions ¶
Types ¶
type Item ¶
type Item struct {
Date time.Time `json:"date"`
Name string `json:"name"`
Pathname string `json:"pathname"`
IsDir bool `json:"isDir"`
Size int64 `json:"size"`
}
Item describe item on a storage provider
type Storage ¶
type Storage interface {
WithIgnoreFn(ignoreFn func(Item) bool) Storage
Info(pathname string) (Item, error)
List(pathname string) ([]Item, error)
WriterTo(pathname string) (io.WriteCloser, error)
ReaderFrom(pathname string) (io.ReadSeekCloser, error)
Walk(pathname string, walkFn func(Item) error) error
CreateDir(pathname string) error
Rename(oldName, newName string) error
Remove(pathname string) error
UpdateDate(pathname string, date time.Time) error
}
Storage describe action on a storage provider
Click to show internal directories.
Click to hide internal directories.