Documentation
¶
Index ¶
Constants ¶
View Source
const ( // SingleLine will show you only as much detail as fits on a single good line. SingleLine DetailLevel = "_sgl" // Medium is a small amount of detail, but that runs on more than one line. Most likely // it will be two lines long. I just didn't want to guarantee that. Medium = "_medium" // Full is the usual level of detail for a 'show' command. A nice, multi-line thing // that contains all the detail a normal person could ever need. Full = "_full" )
Variables ¶
View Source
var Funcs = templateFuncMap
Funcs is not for general usage, only while in transition to PrettyPrint.
Functions ¶
Types ¶
type DetailLevel ¶
type DetailLevel string
DetailLevel allows us to specify how much detail we want included when we call PrettyPrint
type PrettyPrinter ¶
type PrettyPrinter interface {
PrettyPrint(wr io.Writer, detail DetailLevel) error
}
PrettyPrinter is the common interface used to output different entities in a user friendly way
type TemplateFragmentMapper ¶
type TemplateFragmentMapper interface {
MapTemplateFragment(templateFrag string) (strs []string, err error)
}
TemplateFragmentMapper is an interface that requires MapTemplateFragment to exist. The implementation of MapTemplateFragment should add "{{" and "}}" to the beginning and end of template fragment, and run it for each element in the receiver, collecting the output up into an array of strings.
type Test ¶
type Test struct { Object PrettyPrinter Detail DetailLevel Expected string }
Test represents a test that can be used with RunPrettyPrintTest - it's not for general use outside of testing.
Click to show internal directories.
Click to hide internal directories.