storage

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrEngineAlreadyRegistered is raise dwhen trying to register an existent engine.
	ErrEngineAlreadyRegistered = errors.New("engine: storage engine already registered")
)
View Source
var ErrSecretNotFound = errors.New("engine: secret not found")

ErrSecretNotFound is raised when trying to access non-existing secret.

Functions

func MustRegister

func MustRegister(name string, factory EngineFactoryFunc)

MustRegister try to register the engine and panic on error.

func Register

func Register(name string, factory EngineFactoryFunc) error

Register a new storage engine.

Types

type Engine

type Engine interface {
	Get(ctx context.Context, id string) ([]byte, error)
}

Engine represents storage engine contract

func Build

func Build(uri string) (Engine, error)

Build an engine instance with given URL.

type EngineFactoryFunc

type EngineFactoryFunc func(*url.URL) (Engine, error)

EngineFactoryFunc is the storage engine factory contract.

Directories

Path Synopsis
backends
gcs
s3
decorators
test

Jump to

Keyboard shortcuts

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