Documentation
¶
Overview ¶
Package storage can be used to persist files in a storage. It is Open-Stack Swift in production, but having a Swift server in local for development can be difficult, so this package can also used a local file system for the storage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFS ¶
func NewFS(baseDir string) base.VirtualStorage
NewFS returns a VirtualStorage where the files are persisted in the given directory of the local file system.
func NewMemFS ¶
func NewMemFS() base.VirtualStorage
NewMemFS returns a storage where files are kept in memory. Obviously, it must not be used in production, but it can be convenient for unit tests.
func NewSwift ¶
func NewSwift(conn *swift.Connection) base.VirtualStorage
NewSwift returns a VirtualStorage where the files are persisted in Swift.
func RetryWithExpBackoff ¶
RetryWithExpBackoff can be used to call several times a function until it returns no error or the maximum count of calls has been reached. Between two calls, it will wait, first by the given delay, and after that, the delay will double after each failure.
Types ¶
This section is empty.