broadcast

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 (

	// MaxBucketID is the skademlia max bucket ID (index)
	MaxBucketID = 255
)

Variables

This section is empty.

Functions

func New

func New() *block

New sets up and returns a new Relay block instance.

func SendMessage

func SendMessage(node *noise.Node, from kad.ID, data []byte, minBucket int, maxBucket int)

SendMessage starts broadcasting custom data bytes to the network.

Types

type Message

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

Message is a message to be broadcasted with custom data.

func NewMessage

func NewMessage(from kad.ID, prefixlen uint16, 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