providers

package
v0.0.0-...-9fdd194 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: Apache-2.0, MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrStateStoreNotFound = errors.New("not found in state store")
	ErrFileStoreNotFound  = errors.New("not found in file store")
)

Functions

This section is empty.

Types

type BtfsAPI

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

func NewBtfsAPI

func NewBtfsAPI(options ...BtfsAPIOption) (api *BtfsAPI, err error)

func (*BtfsAPI) Cat

func (api *BtfsAPI) Cat(id string) (rc io.ReadCloser, err error)

func (*BtfsAPI) Remove

func (api *BtfsAPI) Remove(id string) (err error)

func (*BtfsAPI) Store

func (api *BtfsAPI) Store(r io.Reader) (id string, err error)

type BtfsAPIOption

type BtfsAPIOption func(api *BtfsAPI)

func BtfsAPIWithBtfsAPIHeaderTimeout

func BtfsAPIWithBtfsAPIHeaderTimeout(timeout time.Duration) BtfsAPIOption

func BtfsAPIWithEndpointUrl

func BtfsAPIWithEndpointUrl(url string) BtfsAPIOption

func BtfsAPIWithTimeout

func BtfsAPIWithTimeout(timeout time.Duration) BtfsAPIOption

type FileStorer

type FileStorer interface {
	Store(r io.Reader) (id string, err error)
	Remove(id string) (err error)
	Cat(id string) (readCloser io.ReadCloser, err error)
}

type Option

type Option func(providers *Providers)

type Providers

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

func NewProviders

func NewProviders(stateStore StateStorer, fileStore FileStorer, options ...Option) (providers *Providers)

func (*Providers) FileStore

func (p *Providers) FileStore() FileStorer

func (*Providers) StateStore

func (p *Providers) StateStore() StateStorer

type Providerser

type Providerser interface {
	FileStore() FileStorer
	StateStore() StateStorer
}

type StateStoreIterFunc

type StateStoreIterFunc func(key, value []byte) (stop bool, err error)

type StateStorer

type StateStorer interface {
	Get(key string, i interface{}) (err error)
	Put(key string, i interface{}) (err error)
	Delete(key string) (err error)
	Iterate(prefix string, iterFunc StateStoreIterFunc) (err error)
}

type StorageStateStoreProxy

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

func NewStorageStateStoreProxy

func NewStorageStateStoreProxy(to storage.StateStorer) *StorageStateStoreProxy

func (*StorageStateStoreProxy) Delete

func (s *StorageStateStoreProxy) Delete(key string) (err error)

func (*StorageStateStoreProxy) Get

func (s *StorageStateStoreProxy) Get(key string, i interface{}) (err error)

func (*StorageStateStoreProxy) Iterate

func (s *StorageStateStoreProxy) Iterate(prefix string, iterFunc StateStoreIterFunc) (err error)

func (*StorageStateStoreProxy) Put

func (s *StorageStateStoreProxy) Put(key string, val interface{}) (err error)

Jump to

Keyboard shortcuts

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