store

package
v0.0.51 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry added in v0.0.51

type Entry struct {
	Dat      dat.Dat
	Replicas [network.FANOUT]uint64
}

func (Entry) Marshal added in v0.0.51

func (e Entry) Marshal(buf []byte) (int, error)

func (*Entry) Unmarshal added in v0.0.51

func (e *Entry) Unmarshal(buf []byte) error

type Store

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

func NewStore added in v0.0.51

func NewStore(cfg *StoreCfg) *Store

func (*Store) Capacity added in v0.0.51

func (s *Store) Capacity() int64

func (*Store) ListAll added in v0.0.51

func (s *Store) ListAll() <-chan Entry

func (*Store) ListWithReplicaID added in v0.0.51

func (s *Store) ListWithReplicaID(id uint64) <-chan Entry

func (*Store) Read added in v0.0.51

func (s *Store) Read(publicKey ed25519.PublicKey, datKey string) (Entry, error)

func (*Store) ReadBackup added in v0.0.51

func (s *Store) ReadBackup() error

func (*Store) Used added in v0.0.51

func (s *Store) Used() int64

func (*Store) Write added in v0.0.51

func (s *Store) Write(e *Entry) error

type StoreCfg

type StoreCfg struct {
	MyID           uint64
	Capacity       int64
	BackupFilename string
	Kill           <-chan struct{}
	Done           chan<- struct{}
	Logger         logger.Logger
}

Jump to

Keyboard shortcuts

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