utils

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const HexPrefix = "0x"

Hex prefix

Variables

View Source
var ErrParsingAddress = errors.New("failed to parse network address")

Functions

func GetPort

func GetPort(addr string) (string, error)

Pick out the port from a full address

func Hash added in v0.10.4

func Hash(result []byte) []byte

Hash returns ripemd160 hash of the given input

func PrefixHex added in v0.10.8

func PrefixHex(in string) string

Types

type PriorityQueue added in v0.10.4

type PriorityQueue []*Queued

A PriorityQueue implements heap.Interface and holds Items.

func (PriorityQueue) Len added in v0.10.4

func (vq PriorityQueue) Len() int

func (PriorityQueue) Less added in v0.10.4

func (vq PriorityQueue) Less(i, j int) bool

func (*PriorityQueue) Pop added in v0.10.4

func (vq *PriorityQueue) Pop() interface{}

func (*PriorityQueue) Push added in v0.10.4

func (vq *PriorityQueue) Push(x interface{})

func (PriorityQueue) Swap added in v0.10.4

func (vq PriorityQueue) Swap(i, j int)

func (*PriorityQueue) Update added in v0.10.4

func (vq *PriorityQueue) Update(item *Queued, value []byte, priority int64)

update modifies the priority and value of an Queued in the queue.

type Queued added in v0.10.4

type Queued struct {
	// contains filtered or unexported fields
}

An Queued is a priority queue we hold for validators

func NewQueued added in v0.10.4

func NewQueued(value []byte, priority int64, index int) *Queued

func (Queued) Priority added in v0.10.4

func (q Queued) Priority() int64

func (Queued) Value added in v0.10.4

func (q Queued) Value() []byte

Jump to

Keyboard shortcuts

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