badger

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegistrationKey

func RegistrationKey(pk types.PublicKey) ds.Key

func RegistrationTimeKey

func RegistrationTimeKey(pk types.PublicKey) ds.Key

Types

type DB

type DB interface {
	Get(context.Context, ds.Key) ([]byte, error)
	PutWithTTL(context.Context, ds.Key, []byte, time.Duration) error
}

type Datastore

type Datastore struct {
	DB

	TTL time.Duration
	// contains filtered or unexported fields
}

func NewDatastore

func NewDatastore(t DB, ttl time.Duration) *Datastore

func (*Datastore) GetRegistration

func (s *Datastore) GetRegistration(ctx context.Context, pk types.PublicKey) (svr types.SignedValidatorRegistration, err error)

func (*Datastore) PopulateAllRegistrations

func (s *Datastore) PopulateAllRegistrations(ctx context.Context, out chan structs.ValidatorCacheEntry) error

func (*Datastore) PutNewerRegistration

func (s *Datastore) PutNewerRegistration(ctx context.Context, pk types.PublicKey, registration types.SignedValidatorRegistration) error

Jump to

Keyboard shortcuts

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