encoding

package
v0.15.3-patch.6-disabl... Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: AGPL-3.0 Imports: 1 Imported by: 2 modules, 8 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// RandomBeaconTag is used for threshold signatures in the random beacon
	RandomBeaconTag = tag("Random-Beacon")
	// ConsensusVoteTag is used for Consensus Hotstuff votes
	ConsensusVoteTag = tag("Consensus-Vote")
	// CollectorVoteTag is used for Collection Hotstuff votes
	CollectorVoteTag = tag("Collector-Vote")
	// ExecutionReceiptTag is used for execution receipts
	ExecutionReceiptTag = tag("Execution-Receipt")
	// ResultApprovalTag is used for result approvals
	ResultApprovalTag = tag("Result-Approval")
	// SPOCKTag is used to generate SPoCK proofs
	SPOCKTag = tag("SPoCK")
)

Functions

This section is empty.

Types

type Encodable

type Encodable interface {
	Encode() []byte
}

Encodable is a type that defines a canonical encoding.

type Encoder

type Encoder interface {
	// Encode encodes a value as bytes.
	//
	// This function returns an error if the value type is not supported by this encoder.
	Encode(interface{}) ([]byte, error)

	// Decode decodes bytes into a value.
	//
	// This functions returns an error if the bytes do not fit the provided value type.
	Decode([]byte, interface{}) error

	// MustEncode encodes a value as bytes.
	//
	// This functions panic if encoding fails.
	MustEncode(interface{}) []byte

	// MustDecode decodes bytes into a value.
	//
	// This functions panic if decoding fails.
	MustDecode([]byte, interface{})
}

Encoder encodes and decodes values to and from bytes.

var DefaultEncoder Encoder = json.NewEncoder()

DefaultEncoder is the default encoder used by Flow.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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