Documentation
¶
Overview ¶
Package show provides some formatter tools for display data.
Index ¶
- Constants
- func AList(title string, data any, fns ...ListOpFunc)
- func ATitle(titleText string, fns ...title.OptionFunc)
- func Banner(content any, fns ...banner.OptionFunc)
- func JSON(v any, prefixAndIndent ...string) int
- func MList(listMap any, fns ...ListOpFunc)
- func NewBanner(content any, fns ...banner.OptionFunc) *banner.Banner
- func NewList(title string, data any, fns ...ListOpFunc) *lists.List
- func NewLists(listMap any, fns ...ListOpFunc) *lists.Lists
- func TabWriter(rows []string) *tabwriter.Writer
- type FormatterFace
- type ListOpFunc
- type ListOption
- type PrettyJSON
- type ShownFace
- type Writer
Constants ¶
View Source
const ( // OK success exit code OK = 0 // ERR error exit code ERR = 2 )
Variables ¶
This section is empty.
Functions ¶
func AList ¶
func AList(title string, data any, fns ...ListOpFunc)
AList create a List instance and print. options see: Options
Usage:
show.AList("some info", map[string]string{"name": "tom"})
func ATitle ¶ added in v3.3.0
func ATitle(titleText string, fns ...title.OptionFunc)
ATitle create a Title instance and print. options see: TitleOption
func Banner ¶ added in v3.3.0
func Banner(content any, fns ...banner.OptionFunc)
Banner create a Banner instance and print. options see: banner.Options
func MList ¶
func MList(listMap any, fns ...ListOpFunc)
MList show multi list data. options see: Options
Usage:
show.MList(data)
show.MList(data, func(opts *Options) {
opts.LeftIndent = " "
})
func NewBanner ¶ added in v3.3.0
func NewBanner(content any, fns ...banner.OptionFunc) *banner.Banner
NewBanner create a Banner instance. options see: banner.Options
func NewList ¶
func NewList(title string, data any, fns ...ListOpFunc) *lists.List
NewList create a List instance. options see: Options
Types ¶
type ListOpFunc ¶ added in v3.1.0
type ListOpFunc = lists.OptionFunc
type ListOption ¶
ListOption alias for lists.Options. for compatible
type PrettyJSON ¶ added in v3.1.1
PrettyJSON struct
Click to show internal directories.
Click to hide internal directories.