utils

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2022 License: BSD-3-Clause Imports: 10 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ColorAndPrepend added in v1.0.1

func ColorAndPrepend(reader io.Reader, writer io.Writer, prependText string, color logging.Color)

ColorAndPrepend reads each line from [reader], prepends it with [prependText] and colors it with [color], and then prints the prepended/colored line to [writer].

func NetworkIDFromGenesis

func NetworkIDFromGenesis(genesis []byte) (uint32, error)

Returns the network ID in the given genesis

func NewColorPicker added in v1.0.1

func NewColorPicker() *colorPicker

NewColorPicker allows to assign a color to different clients

func NewK8sNodeConfigJsonRaw

func NewK8sNodeConfigJsonRaw(
	api,
	id,
	image,
	kind,
	namespace,
	tag string,
) json.RawMessage

NewK8sNodeConfigJsonRaw returns a JSON formatted string as json.RawMessage for a kubernetes node config object (ImplSpecificConfig)

func NewLocalNodeConfigJsonRaw

func NewLocalNodeConfigJsonRaw(binaryPath string) json.RawMessage

NewLocalNodeConfigJsonRaw returns a JSON formatted string as json.RawMessage for a local node config object (ImplSpecificConfig)

func ToNodeID

func ToNodeID(stakingKey, stakingCert []byte) (ids.ShortID, error)

Types

type ColorPicker added in v1.0.1

type ColorPicker interface {
	// get the next color
	NextColor() logging.Color
}

ColorPicker allows to assign a new color

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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