prettyprint

package
v0.20.9 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2020 License: Apache-2.0 Imports: 6 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextKeyGenesisHash = contextKey("genesis/hash")

ContextKeyGenesisHash is the key to retrieve the Genesis document's hash value from a context.

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