storage

package
v0.0.0-...-e282ec7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound = errors.New("not found")
)

Functions

func Init

func Init() error

func IsErrInvalidConfiguration

func IsErrInvalidConfiguration(err error) bool

func RegisterStorageGenerator

func RegisterStorageGenerator(typ Type, generator Generator)

func ToConfig

func ToConfig(exampler, cfg interface{}) (interface{}, error)

Types

type ErrInvalidConfiguration

type ErrInvalidConfiguration struct {
	// contains filtered or unexported fields
}

func (ErrInvalidConfiguration) Error

func (e ErrInvalidConfiguration) Error() string

type Generator

type Generator func(context.Context, interface{}) (Storage, error)

type ID

type ID string

type Marshaler

type Marshaler interface {
	Unmarshal(v interface{}) error
}

type Object

type Object struct {
	Name   string
	Size   int64
	Reader io.ReadCloser
}

type ReadOption

type ReadOption func(*ReadOptions)

type ReadOptions

type ReadOptions struct {
}

type Storage

type Storage interface {
	Write(f *Object, opts ...WriteOption) (ID, error)
	Read(id ID, opts ...ReadOption) (*Object, error)
	Delete(id ID) error
}
var (
	LFS Storage
)

func NewStorage

func NewStorage(typ string, cfg interface{}) (Storage, error)

type Type

type Type string

type WriteOption

type WriteOption func(*WriteOptions)

func WithID

func WithID(id uint) WriteOption

type WriteOptions

type WriteOptions struct {
	ID uint
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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