common

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ProtocolVersion defines Protocol version, starting from 1
	ProtocolVersion = 0x01
	// HashSize defines the size of hash
	HashSize = 32
	// PKHashSize defines the size of public-key hash
	PKHashSize = 20
	// DKGHashSize defines the size of a DKG hash
	DKGHashSize = 20
)

Variables

View Source
var (
	// ErrNotImplemented indicates the method is not implemented yet
	ErrNotImplemented = errors.New("not implemented")
)
View Source
var MachineEndian = binary.LittleEndian

MachineEndian is the endianess of the machine

View Source
var (
	// ZeroHash32B is 32-bytes of all zero
	ZeroHash32B = Hash32B{}
)

Functions

This section is empty.

Types

type DKGHash added in v0.2.0

type DKGHash [DKGHashSize]byte

DKGHash is 20-byte hash

type Hash32B added in v0.2.0

type Hash32B [HashSize]byte

Hash32B is 32-byte hash

type Node

type Node struct {
	NetworkType string
	Addr        string
}

Node is the root struct to embed the newtork identifier

func NewNode

func NewNode(n string, addr string) *Node

NewNode creates an instance of Peer

func NewTCPNode

func NewTCPNode(addr string) *Node

NewTCPNode creates an instance of Peer with tcp transportation

func (*Node) Network

func (n *Node) Network() string

Network returns the transportation layer type (tcp by default)

func (*Node) String

func (n *Node) String() string

String returns the network address (127.0.0.1:0 by default)

type PKHash added in v0.2.0

type PKHash [PKHashSize]byte

PKHash is 20-byte hash

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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