storage

package
v0.0.0-...-549c83c Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InmemoryStore

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

func NewInmemoryStore

func NewInmemoryStore() *InmemoryStore

func (*InmemoryStore) Backup

func (i *InmemoryStore) Backup() ([]byte, error)

func (*InmemoryStore) Close

func (i *InmemoryStore) Close() error

func (*InmemoryStore) Get

func (i *InmemoryStore) Get(ctx context.Context, key []byte) ([]byte, error)

func (*InmemoryStore) ListenToUpdates

func (i *InmemoryStore) ListenToUpdates() <-chan *Update

func (*InmemoryStore) Restore

func (i *InmemoryStore) Restore(values []byte) error

func (*InmemoryStore) Set

func (i *InmemoryStore) Set(ctx context.Context, key []byte, value interface{}) (err error)

type Store

type Store interface {
	Set(ctx context.Context, key []byte, value interface{}) error
	Get(ctx context.Context, key []byte) ([]byte, error)

	Restore(values []byte) error
	Backup() ([]byte, error)

	ListenToUpdates() <-chan *Update

	Close() error
}

type Update

type Update struct {
	Key   []byte
	Value []byte
}

Jump to

Keyboard shortcuts

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