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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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