announce

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2016 License: ISC Imports: 7 Imported by: 0

Documentation

Overview

maintain a memory pools for network announcements

Index

Constants

View Source
const (
	TypeRPC  = iota
	TypePeer = iota
)

type of listener

Variables

This section is empty.

Functions

func AddCertificate

func AddCertificate(fingerprint *util.FingerprintBytes, certificate []byte)

add a certificate

func AddPeer

func AddPeer(address string, listenType int, data *PeerData) (bool, error)

add a peer announcement to the corresponding LRU

func Finalise

func Finalise()

close the pools

func GetCertificate

func GetCertificate(fingerprint *util.FingerprintBytes) []byte

fetch a certificate

func HasCertificate added in v0.1.2

func HasCertificate(fingerprint *util.FingerprintBytes) bool

certificate already stored

func Initialise

func Initialise()

initialise the pools

func RecentPeers

func RecentPeers(start *gnomon.Cursor, count int, listenType int) ([]interface{}, *gnomon.Cursor, error)

get a the most recently anounced addresses of a given type

Types

type PeerData

type PeerData struct {
	Fingerprint *util.FingerprintBytes
}

a type to store data about a peer

func GetPeer

func GetPeer(address string, listenType int) (*PeerData, error)

look up a p2p neighbour in the LRU

type RecentData

type RecentData struct {
	Address string
	Data    *PeerData
}

type to hold recent data

Jump to

Keyboard shortcuts

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