Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FilesystemStorage ¶
FilesystemStorage implements Storage using the disk filesystem as a storage media
func (FilesystemStorage) DeleteFile ¶
func (fs FilesystemStorage) DeleteFile(path string) error
func (FilesystemStorage) GetRoot ¶
func (fs FilesystemStorage) GetRoot() string
type Storage ¶
type Storage interface { // SaveFile gets the name of a file to save and the data as bytes. // It saves the file somewhere (according to the implementation), // then returns the locationUrl. // // The locationUrl can be a full HTTP URL or a relative URL starting with /. // In case it begins with /, the prefix is intended to be the current server. SaveFile(path string, data []byte) (locationUrl string, err error) // DeleteFile deletes a stored file given its path. // It should have been saved using the same Storage implementation. DeleteFile(path string) error // GetRoot returns the root path (on this device or somewhere else) that this storage implementation // is using to save given data. GetRoot() string }
Storage is an abstraction and can be any storage (filesystem, S3 bucket, CDN, in-memory, ...)
Click to show internal directories.
Click to hide internal directories.