stores

package
v0.0.0-...-817062f Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const MaxSize = 1 << 21

Variables

This section is empty.

Functions

func Hash

func Hash(x []byte) cadata.ID

Types

type ReadChain

type ReadChain []ReadOnly

func (ReadChain) Exists

func (c ReadChain) Exists(ctx context.Context, id cadata.ID) (bool, error)

func (ReadChain) Get

func (c ReadChain) Get(ctx context.Context, id cadata.ID, buf []byte) (int, error)

func (ReadChain) Hash

func (c ReadChain) Hash(x []byte) cadata.ID

func (ReadChain) List

func (c ReadChain) List(ctx context.Context, span cadata.Span, ids []cadata.ID) (n int, err error)

func (ReadChain) MaxSize

func (c ReadChain) MaxSize() int

type ReadOnly

type ReadOnly interface {
	cadata.Getter
	cadata.Lister
}

type Store

type Store interface {
	cadata.Store
}

func NewFSStore

func NewFSStore(fs posixfs.FS) Store

func NewMem

func NewMem() Store

type Void

type Void struct{}

func (Void) Delete

func (s Void) Delete(ctx context.Context, id cadata.ID) error

func (Void) Exists

func (s Void) Exists(ctx context.Context, id cadata.ID) (bool, error)

func (Void) Get

func (s Void) Get(ctx context.Context, id cadata.ID, buf []byte) (int, error)

func (Void) Hash

func (s Void) Hash(x []byte) cadata.ID

func (Void) List

func (s Void) List(ctx context.Context, span cadata.Span, ids []cadata.ID) (int, error)

func (Void) MaxSize

func (s Void) MaxSize() int

func (Void) Post

func (s Void) Post(ctx context.Context, data []byte) (cadata.ID, error)

Jump to

Keyboard shortcuts

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