storestacked

package
v0.0.0-...-7899014 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIgnore = store.ErrIgnore
	Break     = store.Break

	ErrKeyNotFound = store.ErrKeyNotFound
	ErrKeyNotMatch = store.ErrKeyNotMatch
	ErrClosed      = store.ErrClosed
)

Functions

func TestStore

func TestStore(
	t *testing.T,
	testStore store.TestStore,
	scope dscope.Scope,
	wg *pr2.WaitGroup,
)

Types

type Def

type Def struct{}

func (Def) New

func (Def) New() New

type Key

type Key = key.Key

type ReadPolicy

type ReadPolicy uint8
const (
	ReadThrough ReadPolicy = iota
	ReadThroughCaching
	ReadAround
)

func (ReadPolicy) String

func (i ReadPolicy) String() string

type Store

type Store struct {
	Upstream store.Store
	Backing  store.Store

	ReadPolicy  ReadPolicy
	WritePolicy WritePolicy
	// contains filtered or unexported fields
}

func (*Store) Delete

func (s *Store) Delete(keys []Key) (err error)

func (*Store) Exists

func (s *Store) Exists(key Key) (bool, error)

func (*Store) ID

func (s *Store) ID() (StoreID, error)

func (*Store) IterAllKeys

func (s *Store) IterAllKeys(fn func(Key) error) (err error)

func (*Store) IterKeys

func (s *Store) IterKeys(ns key.Namespace, fn func(Key) error) (err error)

func (*Store) Name

func (s *Store) Name() string

func (*Store) Read

func (s *Store) Read(key Key, fn func(sb.Stream) error) (err error)

func (*Store) Write

func (s *Store) Write(
	ns key.Namespace,
	stream sb.Stream,
	options ...WriteOption,
) (res store.WriteResult, err error)

type StoreID

type StoreID = store.ID

type WriteOption

type WriteOption = store.WriteOption

type WritePolicy

type WritePolicy uint8
const (
	WriteThrough WritePolicy = iota
	WriteAround
)

func (WritePolicy) String

func (i WritePolicy) String() string

Jump to

Keyboard shortcuts

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