proto

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2018 License: Unlicense Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Errors = CommonErrors{
	"nil receiver", "nil parameter", "nil buffer", "zero length parameter", "index out of bounds", "invalid type", "zero length buffer",
}

Errors gives a short readable reference to indicate a common error string

View Source
var StringCodings = []string{
	"bytes",
	"string",
	"decimal",
	"hex",
	"base32",
	"base58check",
	"base64",
}

StringCodings is a list of the names of encoding types for the stringer

Functions

func Zero

func Zero(b *[]byte)

Zero makes all the bytes in a slice zero

Types

type Address

type Address string

Address is used as the key for searching for public keys (addresses also), scripts, transactions and blocks, generated using the hash160 function, which is a sha256 followed by ripemd160.

type Array

type Array interface {
	SetElem(index int, in interface{}) Array
	GetElem(index int) (out interface{})
	Len() int
}

Array is an interface to access elements of a buffer

type Buffer

type Buffer interface {
	Bytes() (out *[]byte)
	Copy(in *[]byte) Buffer
	Zero() Buffer
	Free() Buffer
	IsEqual(*[]byte) bool
}

Buffer is a generic interface for []byte buffers

type Coder

type Coder interface {
	GetCoding() (out *string)
	SetCoding(in string) Coder
	ListCodings() (out *[]string)
}

Coder is an interface for encoding raw bytes in various base number formats

type CommonErrors

type CommonErrors struct {
	NilRec, NilParam, NilBuf, ZeroLen, OutOfBounds, InvalidType, ZeroLenBuf string
}

CommonErrors are common error values from library functions

type H160

type H160 interface {
	GetAddress() Address
}

H160 is a 20 byte hash created with hash160.Sum that is used as a key for scripts and addresses

type H256

type H256 interface {
	GetHash() Hash
}

H256 is a 32 byte hash created with SHA256 that is used for transactions, blocks, and message hashes

type Hash

type Hash string

Hash is a 256 byte hash stored as a string for use with maps, used for block hashes, transaction hashes, message hashes, and other things

type MerkleTx

type MerkleTx struct {
	HashBlock    [32]byte
	MerkleBranch [32]byte
	Index        int64
	// contains filtered or unexported fields
}

MerkleTx is the merkle tree hash data for a transaction

type Status

type Status interface {
	SetStatus(string) Status
	SetStatusIf(error) Status
	UnsetStatus() Status
	OK() bool
}

Status keeps track of errors on an ongoing basis and hooks into the logger which fills with snapshots of data state for debugging

type Streamer

type Streamer interface {
	Freeze() (out *[]byte)
	Thaw(in *[]byte) Streamer
}

Streamer is an interface for serialising data

Jump to

Keyboard shortcuts

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