relay

package
v1.1.1-0...-495e22c Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RelayChanSize is the default relay msg buffer size
	RelayChanSize = 100
)

Variables

This section is empty.

Functions

func New

func New() *block

New sets up and returns a new Relay block instance.

func ToPeer

func ToPeer(node *noise.Node, targetID kad.ID, msg Message)

ToPeer relays a custom Message to peer synchronously.

Types

type Message

type Message struct {
	From kad.ID
	To   kad.ID
	Hash [32]byte
	Data []byte
}

Message is a message to be relayed to To node with custom data.

func NewMessage

func NewMessage(from kad.ID, to kad.ID, data []byte) *Message

NewMessage creates a new Message instance.

func (Message) Read

func (m Message) Read(reader payload.Reader) (noise.Message, error)

func (Message) Write

func (m Message) Write() []byte

Jump to

Keyboard shortcuts

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