Documentation
¶
Index ¶
- Constants
- func AllElem(in interface{}) reflect.Value
- func IsPtr(in interface{}) bool
- func IsUnsafePointer(in interface{}) bool
- func Log(msg string) int
- func Marshal(in interface{}) ([]byte, error)
- func SetDisplay(f func([]byte) int)
- func TypeOf(in interface{}) reflect.Type
- func Unmarshal(jsonstr []byte, out interface{}) error
- func ValueOf(in interface{}) reflect.Value
- type BaseName
- type BaseOpt
- type BoolOpt
- type EmptyStruct
- type IntOpt
- type MapOpt
- type SliceOpt
- type StringOpt
- type StructOpt
- type UintOpt
Constants ¶
View Source
const ( OmitEmpty = "omitempty" RustOption = "rust_option" OptSeen = "opt_seen" )
Variables ¶
This section is empty.
Functions ¶
func IsUnsafePointer ¶
func IsUnsafePointer(in interface{}) bool
func SetDisplay ¶
Types ¶
type BaseName ¶
type BaseName struct {
// contains filtered or unexported fields
}
func (BaseName) GetJsonName ¶
func (BaseName) IsOmitEmpty ¶
func (BaseName) IsRustOption ¶
type BaseOpt ¶
type BaseOpt interface {
//checking is value empty
IsEmpty() bool
//get encoded result
Encode(isBrace bool) string
//getting Value name
Name() string
//getting value
Value() interface{}
//getting type
Type() reflect.Kind
//getting tag
Tag() string
//setting values
Set(value interface{}) error
//setting attribute
Attribute(key string, value bool)
// whether we need to make a seen field on the struct
// currently only for EmptyStruct, may extend this later
IsOptSeen() bool
}
type EmptyStruct ¶
type EmptyStruct struct {
Seen bool `json:"do_not_set_this_field,omitempty"`
}
Set this as EmptyStruct{Seen: true} so it will serialize, otherwise it is missing
func (EmptyStruct) WasSet ¶
func (e EmptyStruct) WasSet() bool
type IntOpt ¶
type IntOpt struct {
BaseName
// contains filtered or unexported fields
}
/int int16 int32 int64 support
type SliceOpt ¶
type SliceOpt struct {
BaseName
// contains filtered or unexported fields
}
slice support
type StringOpt ¶
type StringOpt struct {
BaseName
// contains filtered or unexported fields
}
/string support
type StructOpt ¶
type StructOpt struct {
BaseName
// contains filtered or unexported fields
}
struct support
Click to show internal directories.
Click to hide internal directories.