Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FriendlyMapLabel ¶
FriendlyMapLabel returns a user-friendly label for the given map value.
func FriendlySliceLabel ¶
FriendlySliceLabel returns a user-friendly label for the given slice value.
func FriendlyStructLabel ¶
FriendlyStructLabel returns a user-friendly label for the given struct value.
func FriendlyTypeName ¶
FriendlyTypeName returns a user-friendly version of the name of the given type. It transforms it into sentence case, excludes the package, and converts various builtin types into more friendly forms (eg: "int" to "Number").
func ToLabel ¶
ToLabel returns the GUI-appropriate label for an item, using the Labeler interface if it is defined, and falling back on reflectx.ToString converter otherwise.
Types ¶
type Labeler ¶
type Labeler interface { // Label returns a GUI-appropriate label for item Label() string }
Labeler interface provides a GUI-appropriate label for an item, via a Label string method. See ToLabel and ToLabeler.
type SliceLabeler ¶
type SliceLabeler interface { // ElemLabel returns a GUI-appropriate label for slice element at given index. ElemLabel(idx int) string }
SliceLabeler interface provides a GUI-appropriate label for a slice item, given an index into the slice.