pidstore

package
v0.18.0-not-final-expe... Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PeerIDStore

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

PeerIDStore is used to store/load peers to/from disk.

func NewPeerIDStore

func NewPeerIDStore(ctx context.Context, ds datastore.Datastore) (*PeerIDStore, error)

NewPeerIDStore creates a new peer ID store backed by the given datastore.

func (*PeerIDStore) Load

func (p *PeerIDStore) Load(ctx context.Context) ([]peer.ID, error)

Load loads the peers from datastore and returns them.

func (*PeerIDStore) Put

func (p *PeerIDStore) Put(ctx context.Context, peers []peer.ID) error

Put persists the given peer IDs to the datastore.

Jump to

Keyboard shortcuts

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