file

package
v1.1.11 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFileBackend

func NewFileBackend(conf map[string]string, logger log.Logger) (physical.Backend, error)

NewFileBackend constructs a FileBackend using the given directory

func NewTransactionalFileBackend

func NewTransactionalFileBackend(conf map[string]string, logger log.Logger) (physical.Backend, error)

Types

type FBackend

type FBackend struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

FBackend is a physical backend that stores data on disk at a given file path. It can be used for durable single server situations, or to develop locally where durability is not critical.

WARNING: the file backend implementation is currently extremely unsafe and non-performant. It is meant mostly for local testing and development. It can be improved in the future.

func (*FBackend) Delete

func (b *FBackend) Delete(ctx context.Context, path string) error

func (*FBackend) DeleteInternal

func (b *FBackend) DeleteInternal(ctx context.Context, path string) error

func (*FBackend) Get

func (b *FBackend) Get(ctx context.Context, k string) (*physical.Entry, error)

func (*FBackend) GetInternal

func (b *FBackend) GetInternal(ctx context.Context, k string) (*physical.Entry, error)

func (*FBackend) List

func (b *FBackend) List(ctx context.Context, prefix string) ([]string, error)

func (*FBackend) ListInternal

func (b *FBackend) ListInternal(ctx context.Context, prefix string) ([]string, error)

func (*FBackend) Put

func (b *FBackend) Put(ctx context.Context, entry *physical.Entry) error

func (*FBackend) PutInternal

func (b *FBackend) PutInternal(ctx context.Context, entry *physical.Entry) error

type TransactionalFileBackend

type TransactionalFileBackend struct {
	FBackend
}

func (*TransactionalFileBackend) Transaction

func (b *TransactionalFileBackend) Transaction(ctx context.Context, txns []*physical.TxnEntry) error

Jump to

Keyboard shortcuts

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