peer

package
v0.0.0-...-2ec1701 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2014 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 ID

type ID mh.Multihash

ID is a byte slice representing the identity of a peer.

func (*ID) Equal

func (id *ID) Equal(other *ID) bool

Utililty function for comparing two peer ID's

type Map

type Map map[u.Key]*Peer

Map maps Key (string) : *Peer (slices are not comparable).

type Peer

type Peer struct {
	ID        ID
	Addresses []*ma.Multiaddr
}

Peer represents the identity information of an IPFS Node, including ID, and relevant Addresses.

func (*Peer) AddAddress

func (p *Peer) AddAddress(a *ma.Multiaddr)

AddAddress adds the given Multiaddr address to Peer's addresses.

func (*Peer) Key

func (p *Peer) Key() u.Key

Key returns the ID as a Key (string) for maps.

func (*Peer) NetAddress

func (p *Peer) NetAddress(n string) *ma.Multiaddr

NetAddress returns the first Multiaddr found for a given network.

Jump to

Keyboard shortcuts

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