message

package
v0.0.0-...-e4696f9 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2014 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NetMessage

type NetMessage interface {
	Peer() peer.Peer
	Data() []byte
}

NetMessage is the interface for the message

func FromObject

func FromObject(p peer.Peer, data proto.Message) (NetMessage, error)

FromObject creates a message from a protobuf-marshallable message.

func New

func New(p peer.Peer, data []byte) NetMessage

New is the interface for constructing a new message.

type Pipe

type Pipe struct {
	Incoming chan NetMessage
	Outgoing chan NetMessage
}

Pipe objects represent a bi-directional message channel.

func NewPipe

func NewPipe(bufsize int) *Pipe

NewPipe constructs a pipe with channels of a given buffer size.

func (*Pipe) ConnectTo

func (p *Pipe) ConnectTo(p2 *Pipe)

ConnectTo connects this pipe to another, using a context for termination.

Jump to

Keyboard shortcuts

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