store

package
v0.0.0-...-1bfa4a9 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2021 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MultiAddrStore

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

MultiAddrStore is a store of `wire.Address`es.

func New

func New(store db.Table, bootstrapAddrs []wire.Address) MultiAddrStore

New constructs a new `MultiAddrStore`.

func (*MultiAddrStore) AddrsAll

func (multiStore *MultiAddrStore) AddrsAll() ([]wire.Address, error)

AddrsAll returns all of the multi-addresses in the store.

func (*MultiAddrStore) BootstrapAll

func (multiStore *MultiAddrStore) BootstrapAll() ([]wire.Address, error)

BootstrapAll returns the multi-addresses of all of the Bootstrap nodes.

func (*MultiAddrStore) Delete

func (multiStore *MultiAddrStore) Delete(addr wire.Address) error

Delete removes the given multi-address from the store.

func (*MultiAddrStore) Get

func (multiStore *MultiAddrStore) Get(id string) (wire.Address, error)

Get retrieves a multi-address from the store.

func (*MultiAddrStore) Insert

func (multiStore *MultiAddrStore) Insert(addr wire.Address) error

Insert puts the given multi-address into the store.

func (*MultiAddrStore) RandomAddrs

func (multiStore *MultiAddrStore) RandomAddrs(n int) ([]wire.Address, error)

RandomAddrs returns a random number of multi-addresses in the store.

func (*MultiAddrStore) RandomBootstrapAddrs

func (multiStore *MultiAddrStore) RandomBootstrapAddrs(n int) ([]wire.Address, error)

RandomBootstrapAddrs returns a random number of Bootstrap multi-addresses in the store.

func (*MultiAddrStore) Size

func (multiStore *MultiAddrStore) Size() (int, error)

Size returns the number of entries in the store.

Jump to

Keyboard shortcuts

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