pstore

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTableName = "peer"

DefaultTableName is the default table name for peer storage

Variables

This section is empty.

Functions

func NewAddrBook

func NewAddrBook(parent goprocess.Process, s storage.Table, bus eventbus.Bus, cacheSize int) peerstore.AddrBook

NewAddrBook creates a new instance of AddrBook

func NewDefaultAddrBook

func NewDefaultAddrBook(proc goprocess.Process, s storage.Storage, bus eventbus.Bus) (peerstore.AddrBook, error)

NewDefaultAddrBook creates a default addrbook

func NewDefaultPeerstoreWithAddrBook

func NewDefaultPeerstoreWithAddrBook(proc goprocess.Process, s storage.Storage, ab peerstore.AddrBook) (peerstore.Peerstore, error)

NewDefaultPeerstoreWithAddrBook creates a default peerstore for P2P

func NewKeyBook

func NewKeyBook(_ goprocess.Process, store storage.Table) (peerstore.KeyBook, error)

NewKeyBook creates a keybook using storage.Table

func NewPeerMetadata

func NewPeerMetadata(_ goprocess.Process, store storage.Table) (peerstore.PeerMetadata, error)

NewPeerMetadata creates a metadata store backed by a persistent db. It uses gob for serialisation.

See `init()` to learn which types are registered by default. Modules wishing to store values of other types will need to `gob.Register()` them explicitly, or else callers will receive runtime errors.

Types

type NodeInfo

type NodeInfo struct {
	TTL    time.Duration
	PeerID peer.ID
	Addr   []string
	Valid  bool
}

NodeInfo contains status info about a peer, including peer id, protocol, ip addresses and ttl

Jump to

Keyboard shortcuts

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