storage

package
v0.0.0-...-ec7abc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 13 Imported by: 0

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

func RetryWithExpBackoff(count int, delay time.Duration, fn func() error) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL