wire

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 7 Imported by: 20

Documentation

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 serializable 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 serializable 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