Documentation ¶
Index ¶
- type Formatters
- type Representer
- type View
- func (j *View) Expandable(path string, obj interface{}) interface{}
- func (j *View) NewPusher(label string, name string, obj interface{}, fmts *Formatters) interface{}
- func (j *View) Pop()
- func (j *View) Push(name string, obj interface{}, fmt *Formatters)
- func (j *View) Set(name string, obj interface{}, fmt *Formatters)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Formatters ¶
type Formatters struct {
// contains filtered or unexported fields
}
Formatters is a collection of functions that can format the values on certain paths (e.g. myStruct/myField/mySubfield) in an object hierarchy in an application-specific way (e.g. render a URL string as a link).
func NewFormatters ¶
func NewFormatters() *Formatters
NewFormatters instantiates a new Formatters collection.
func (*Formatters) Add ¶
func (f *Formatters) Add(pattern string, fun func(string, interface{}) interface{}) *Formatters
Add registers a formatting function that is applied to paths matching the given pattern.
type Representer ¶
type Representer interface {
Representation() interface{}
}
Representer is implemented by objects wishing to provide their own representation for use in the object viewer.
type View ¶
View is a DOM element that can render arbitrary go structures as tables for inspection purposes. It supports a stack of objects with breadcrumb navigation.
func (*View) Expandable ¶
Expandable is a formatting function that formats a value as a link that pushes that value onto the object viewer stack.
func (*View) NewPusher ¶
func (j *View) NewPusher(label string, name string, obj interface{}, fmts *Formatters) interface{}
NewPusher returns a link which, when clicked, pushes the given object onto the stack.
func (*View) Push ¶
func (j *View) Push(name string, obj interface{}, fmt *Formatters)
Push pushes a new object onto the stack with the given name and formatters. Any objects in the navigation bar past the currently selected one are discarded and replaced with the new object.
func (*View) Set ¶
func (j *View) Set(name string, obj interface{}, fmt *Formatters)
Set sets the viewer stack to the single passed object, with the given name (in the navigation bar) and formatters.