prettyprint

package
v0.2012.6 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2021 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ContextKeyGenesisHash is the key to retrieve the Genesis document's hash
	// value from a context.
	ContextKeyGenesisHash = contextKey("genesis/hash")
	// ContextKeyTokenSymbol is the key to retrieve the token's ticker symbol
	// value from a context.
	ContextKeyTokenSymbol = contextKey("staking/token-symbol")
	// ContextKeyTokenValueExponent is the key to retrieve the token's value
	// base-10 exponent from a context.
	ContextKeyTokenValueExponent = contextKey("staking/token-value-exponent")
	// ContextKeyCommissionScheduleIndex is the key to retrieve the rate (bound)
	// index in a commission schedule (amendment).
	ContextKeyCommissionScheduleIndex = contextKey("staking/commission-schedule-index")
)

Functions

func QuantityFrac

func QuantityFrac(numerator quantity.Quantity, denominatorExp uint8) string

QuantityFrac returns a pretty-printed representation of a quantity fraction for the given numerator and denominator's base-10 exponent.

Types

type PrettyPrinter

type PrettyPrinter interface {
	// PrettyPrint writes a pretty-printed representation of the type
	// to the given writer.
	PrettyPrint(ctx context.Context, prefix string, w io.Writer)

	// PrettyType returns a representation of the type that can be used for pretty printing.
	PrettyType() (interface{}, error)
}

PrettyPrinter is an interface for types that know how to pretty print themselves (e.g., to be displayed in a CLI).

Jump to

Keyboard shortcuts

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