Documentation ¶
Index ¶
- type StructBuilder
- func (instance *StructBuilder) AddFieldByStringType(name, tag string, sType string) *StructBuilder
- func (instance *StructBuilder) AddFieldByValue(name, tag string, value interface{}) *StructBuilder
- func (instance *StructBuilder) Elem() reflect.Value
- func (instance *StructBuilder) EnableAutoTagJson(value bool) *StructBuilder
- func (instance *StructBuilder) Interface() interface{}
- func (instance *StructBuilder) Json() string
- func (instance *StructBuilder) Set(name string, value interface{}) *StructBuilder
- type StructHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StructBuilder ¶
type StructBuilder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder() *StructBuilder
func (*StructBuilder) AddFieldByStringType ¶
func (instance *StructBuilder) AddFieldByStringType(name, tag string, sType string) *StructBuilder
AddFieldByStringType add a field using its string type name with a default value
func (*StructBuilder) AddFieldByValue ¶
func (instance *StructBuilder) AddFieldByValue(name, tag string, value interface{}) *StructBuilder
func (*StructBuilder) Elem ¶
func (instance *StructBuilder) Elem() reflect.Value
Elem return element you can use to add fields: ex. elem.Field(0).SetInt(1234)
func (*StructBuilder) EnableAutoTagJson ¶
func (instance *StructBuilder) EnableAutoTagJson(value bool) *StructBuilder
func (*StructBuilder) Interface ¶
func (instance *StructBuilder) Interface() interface{}
func (*StructBuilder) Json ¶
func (instance *StructBuilder) Json() string
func (*StructBuilder) Set ¶
func (instance *StructBuilder) Set(name string, value interface{}) *StructBuilder
type StructHelper ¶
type StructHelper struct { }
var Structs *StructHelper
func (*StructHelper) NewBuilder ¶
func (instance *StructHelper) NewBuilder() *StructBuilder
Click to show internal directories.
Click to hide internal directories.