store

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 4

Documentation

Index

Constants

View Source
const (
	PrefixPeer     = 1
	PrefixFunction = 2
)
View Source
const (
	Separator = ':'
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec added in v0.6.1

type Codec interface {
	Marshal(any) ([]byte, error)
	Unmarshal([]byte, any) error
}

type Store

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

Store enables interaction with a database.

func New

func New(db *pebble.DB, codec Codec) *Store

New creates a new Store backed by the database at the given path.

func (*Store) Keys

func (s *Store) Keys() []string

Keys returns the list of all keys in the database.

func (*Store) RemoveFunction added in v0.6.1

func (s *Store) RemoveFunction(cid string) error

func (*Store) RemovePeer added in v0.6.1

func (s *Store) RemovePeer(id peer.ID) error

func (*Store) RetrieveFunction added in v0.6.1

func (s *Store) RetrieveFunction(cid string) (blockless.FunctionRecord, error)

func (*Store) RetrieveFunctions added in v0.6.1

func (s *Store) RetrieveFunctions() ([]blockless.FunctionRecord, error)

func (*Store) RetrievePeer added in v0.6.1

func (s *Store) RetrievePeer(id peer.ID) (blockless.Peer, error)

func (*Store) RetrievePeers added in v0.6.1

func (s *Store) RetrievePeers() ([]blockless.Peer, error)

func (*Store) SaveFunction added in v0.6.1

func (s *Store) SaveFunction(function blockless.FunctionRecord) error

func (*Store) SavePeer added in v0.6.1

func (s *Store) SavePeer(peer blockless.Peer) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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