swarm

package
v0.0.0-...-dc1a0b8 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2014 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ChanBuffer = 10

Variables

This section is empty.

Functions

This section is empty.

Types

type Chan

type Chan struct {
	Outgoing chan Message
	Incoming chan Message
	Errors   chan error
	Close    chan bool
}

func NewChan

func NewChan(bufsize int) *Chan

type Conn

type Conn struct {
	Peer *peer.Peer
	Addr *ma.Multiaddr
	Conn net.Conn

	Closed   chan bool
	Outgoing *msgio.Chan
	Incoming *msgio.Chan
}

func Dial

func Dial(network string, peer *peer.Peer) (*Conn, error)

func (*Conn) Close

func (s *Conn) Close() error

type ConnMap

type ConnMap map[u.Key]*Conn

type Message

type Message struct {
	// To or from, depending on direction.
	Peer *peer.Peer

	// Opaque data
	Data []byte
}

type Swarm

type Swarm struct {
	Chan *Chan
	// contains filtered or unexported fields
}

func NewSwarm

func NewSwarm() *Swarm

func (*Swarm) Close

func (s *Swarm) Close()

func (*Swarm) Dial

func (s *Swarm) Dial(peer *peer.Peer) (*Conn, error)

Jump to

Keyboard shortcuts

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