wire

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: May 4, 2020 License: MIT Imports: 7 Imported by: 20

Documentation

Overview

Package wire contains the serialization logic for sending messages between Perun nodes over the wire.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(reader io.Reader, values ...interface{}) (err error)

Decode decodes multiple primitive values from a reader. All passed values must be references, not copies.

func Encode

func Encode(writer io.Writer, values ...interface{}) (err error)

Encode encodes multiple primitive values into a writer. All passed values must be copies, not references.

Types

type BigInt

type BigInt struct {
	*big.Int
}

BigInt is a serializer big integer.

func (*BigInt) Decode

func (b *BigInt) Decode(reader io.Reader) error

Decode reads a big.Int from the given stream.

func (BigInt) Encode

func (b BigInt) Encode(writer io.Writer) error

Encode writes a big.Int to the stream.

type ByteSlice

type ByteSlice []byte

ByteSlice is a serializer byte slice.

func (*ByteSlice) Decode

func (b *ByteSlice) Decode(r io.Reader) error

Decode reads a byte slice from the given stream. Decode reads exactly len(b) bytes. This means the caller has to specify how many bytes he wants to read.

func (ByteSlice) Encode

func (b ByteSlice) Encode(w io.Writer) error

Encode writes len(b) bytes to the stream. Note that the length itself is not written to the stream.

Directories

Path Synopsis
Package msg contains all message types, as well as serialising and deserialising logic used in peer communications.
Package msg contains all message types, as well as serialising and deserialising logic used in peer communications.

Jump to

Keyboard shortcuts

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