print

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func P

func P(name string, opts ...Option) string

P renders the function and arguments as provided to a string

Types

type Option

type Option interface {
	fmt.Stringer
	// contains filtered or unexported methods
}

Option is the command interface for the print package.

func Bool

func Bool(b bool, label ...string) Option

Bool takes a bool with optional label and renders them consistently.

func BoolSilentFalse

func BoolSilentFalse(b bool, label ...string) Option

BoolSilentFalse takes a bool with optional label and renders them consistently. If the value of the bool is false, no output is added.

func BoolSilentTrue

func BoolSilentTrue(b bool, label ...string) Option

BoolSilentTrue takes a bool with optional label and renders them consistently. If the value of the bool is true, no output is added.

func Bytes

func Bytes(b []byte, label ...string) Option

Bytes takes a []byte with optional label and renders them consistently.

func Error

func Error(e error, label ...string) Option

Error takes a error with optional label and renders them consistently.

func Func added in v0.13.0

func Func(f any, label ...string) Option

Func takes a func with optional label and renders them consistently.

func FuncAltNil added in v0.13.0

func FuncAltNil(f any, alt string, label ...string) Option

FuncAltNil renders the function like Func() except the alt string is used for when the function is nil.

func FuncAltNotNil added in v0.13.0

func FuncAltNotNil(f any, alt string, label ...string) Option

FuncAltNotNil renders the function like Func() except the alt string is used for when the function is not nil.

func Int

func Int(i int, label ...string) Option

Int takes an int with optional label and renders them consistently.

func Literal

func Literal(txt string, label ...string) Option

Literal takes a string literal with optional label and renders them consistently.

func LiteralStringers

func LiteralStringers[T fmt.Stringer](list []T, label ...string) Option

LiteralStringerss takes an array of fmt.Stringers literals with optional label and renders them consistently.

func LiteralStrings

func LiteralStrings(s []string, label ...string) Option

LiteralStrings takes an array of string literals with optional label and renders them consistently.

func Obj added in v0.16.0

func Obj(o any, label ...string) Option

Obj takes an object with optional label and renders them consistently.

func String

func String(txt string, label ...string) Option

String takes a string parameter with optional label and renders them consistently.

func StringMap added in v0.9.0

func StringMap(m map[string]string, label ...string) Option

StringMap takes a map of strings to strings parameter with optional label and renders them consistently.

func Stringers

func Stringers[T fmt.Stringer](list []T, label ...string) Option

Stringers takes an array of fmt.Stringers parameters with optional label and renders them consistently.

func Strings

func Strings(s []string, label ...string) Option

Strings takes an array of strings parameter with optional label and renders them consistently.

func SubOpt

func SubOpt() Option

SubOpt denotes when the documented option is not the main goschtalt.Option type and should have it's parenthesis grouped tighter.

func Yields

func Yields(opts ...Option) Option

Yields denotes when a group of options is describing the outcome of set of objects for representation using more of the `Foo() --> things` pattern. The options inside this option are what show up after the -->.

Jump to

Keyboard shortcuts

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