peer

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2016 License: MIT Imports: 5 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Single added in v1.0.0

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

Single implements the Chooser interface for a single peer

func NewSingle added in v1.0.0

func NewSingle(pid peer.Identifier, transport peer.Transport) *Single

NewSingle creates a static Chooser with a single Peer

func (*Single) Choose added in v1.0.0

func (s *Single) Choose(context.Context, *transport.Request) (peer.Peer, func(error), error)

Choose returns the single peer

func (*Single) Introspect added in v1.0.0

func (s *Single) Introspect() introspection.ChooserStatus

Introspect returns a ChooserStatus with a single PeerStatus.

func (*Single) IsRunning added in v1.0.0

func (s *Single) IsRunning() bool

IsRunning is a noop

func (*Single) NotifyStatusChanged added in v1.0.0

func (s *Single) NotifyStatusChanged(_ peer.Identifier)

NotifyStatusChanged receives notifications from the transport when the peer connects, disconnects, accepts a request, and so on.

func (*Single) Start added in v1.0.0

func (s *Single) Start() error

Start is a noop

func (*Single) Stop added in v1.0.0

func (s *Single) Stop() error

Stop is a noop

Directories

Path Synopsis
x

Jump to

Keyboard shortcuts

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