peer

package
v0.0.0-...-43db901 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

type Peer struct {
	PeerQueue *memberlist.TransmitLimitedQueue
	// contains filtered or unexported fields
}

Peer is a type that represents a peer in the Gladius p2p network.

func New

New returns a new peer type

func (*Peer) CompareContent

func (p *Peer) CompareContent(contentList []string) []interface{}

CompareContent compares the content provided with the content in the state and returns a list of the missing files names in the format of: website/<"asset" or "route">/filename

func (p *Peer) GetContentLinks(contentList []string) map[string][]string

GetContentLinks returns a map mapping a file name to all the places it can be found on the network

func (*Peer) GetState

func (p *Peer) GetState() *state.State

GetState returns the current local state

func (*Peer) Join

func (p *Peer) Join(ipList []string) error

Join will request to join the network from a specific node

func (*Peer) SetState

func (p *Peer) SetState(s *state.State)

func (*Peer) StopAndLeave

func (p *Peer) StopAndLeave() error

StopAndLeave will infomr the network of it leaving and shutdown

func (*Peer) UpdateAndPushState

func (p *Peer) UpdateAndPushState(sm *signature.SignedMessage) error

UpdateAndPushState updates the local state and pushes it to several other peers

Jump to

Keyboard shortcuts

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