Documentation
¶
Index ¶
- Constants
- func Format(w io.Writer, v interface{})
- func Print(v interface{})
- type Component
- type ComponentKind
- type DocumentType
- type Encoding
- type Formatter
- type KeyValue
- type NameValue
- type NameValueList
- type UI
- type UIComponents
- type UIDataView
- type UIDocument
- type UIKeyValue
- type UILabel
- type UIValue
- type ValueType
- type Valued
- type Writer
Constants ¶
View Source
const ( KindDocument ComponentKind = 1 KindNameValueList = 2 KindKeyValues = 3 KindLabel = 4 KindDataView = 5 KindComponents = 6 )
View Source
const ( NullValue ValueType = 0 IntValue = 1 UIntValue = 2 StringValue = 3 BytesValue = 4 TimeValue = 5 DurationValue = 6 BooleanValue = 7 JsonValue = 8 XmlValue = 9 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type Component interface {
GetKind() ComponentKind
}
func ToComponent ¶
func ToComponent(def interface{}) Component
func ToComponents ¶
func ToComponents(def ...interface{}) []Component
type ComponentKind ¶
type ComponentKind int
type DocumentType ¶
type DocumentType int
const (
DocHttpTranslate DocumentType = 0
)
func (DocumentType) String ¶
func (m DocumentType) String() string
type NameValue ¶
func NewNamedValue ¶
type NameValueList ¶
type NameValueList struct {
Kind ComponentKind
Name string
Items []*NameValue
}
func NewNameValueList ¶
func NewNameValueList(name string) *NameValueList
func (*NameValueList) Append ¶
func (m *NameValueList) Append(name string, value interface{})
func (*NameValueList) Component ¶
func (m *NameValueList) Component() Component
func (*NameValueList) GetKind ¶
func (m *NameValueList) GetKind() ComponentKind
func (*NameValueList) GetName ¶
func (m *NameValueList) GetName() string
type UIComponents ¶
type UIComponents []Component
func (UIComponents) GetKind ¶
func (m UIComponents) GetKind() ComponentKind
type UIDataView ¶
type UIDataView struct {
Kind ComponentKind
Name string
Value *UIValue
}
func DataView ¶
func DataView(v interface{}) *UIDataView
func (*UIDataView) Component ¶
func (m *UIDataView) Component() Component
func (*UIDataView) GetKind ¶
func (m *UIDataView) GetKind() ComponentKind
func (*UIDataView) GetName ¶
func (m *UIDataView) GetName() string
type UIDocument ¶
type UIDocument struct {
Kind ComponentKind
Name string
Type DocumentType
Components []Component
}
func NewDocument ¶
func NewDocument(doc DocumentType, name string, v ...interface{}) *UIDocument
func (*UIDocument) Add ¶
func (m *UIDocument) Add(components ...Component) *UIDocument
func (*UIDocument) Component ¶
func (m *UIDocument) Component() Component
func (*UIDocument) GetKind ¶
func (m *UIDocument) GetKind() ComponentKind
func (*UIDocument) GetName ¶
func (m *UIDocument) GetName() string
func (*UIDocument) JSON ¶
func (m *UIDocument) JSON() ([]byte, error)
type UIKeyValue ¶
type UIKeyValue struct {
Kind ComponentKind
Items map[string]*UIValue
}
func NewKeyValues ¶
func NewKeyValues(values KeyValue) *UIKeyValue
func (*UIKeyValue) Component ¶
func (m *UIKeyValue) Component() Component
func (*UIKeyValue) GetKind ¶
func (m *UIKeyValue) GetKind() ComponentKind
func (*UIKeyValue) Set ¶
func (m *UIKeyValue) Set(key string, v interface{})
type UILabel ¶
type UILabel struct {
Kind ComponentKind
Name string
Title string
Components []Component
}
func (*UILabel) GetKind ¶
func (m *UILabel) GetKind() ComponentKind
Click to show internal directories.
Click to hide internal directories.