Documentation
¶
Index ¶
- func Builtins() []string
- func Declarables() []string
- func IsBuiltin(typeName string) bool
- func IsDecimal(typeName string) bool
- func IsDeclarable(typeName string) bool
- func IsNative(typeName string) bool
- func NeedCustomUnmarshaler(typeName string) (ok bool, err error)
- type Bool
- type Dec128
- type Dec32
- type Dec64
- type Field
- type FieldCustom
- type FieldRegistrator
- type Float32
- type Float64
- type Hex
- type Hex16
- type Hex32
- type Hex64
- type Hex8
- type ImportedType
- type Int
- type Int16
- type Int32
- type Int64
- type Int8
- type LocalType
- type Oct
- type Oct16
- type Oct32
- type Oct64
- type Oct8
- type Source
- type Str
- type String
- type TypeRegistration
- type Uint
- type Uint16
- type Uint32
- type Uint64
- type Uint8
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Declarables ¶ added in v0.1.1
func Declarables() []string
Declarables return list of builtin declarables type except decX.Y, which should be handled separately
func IsDeclarable ¶ added in v0.1.1
IsDeclarable check if type name can be declared explicitly (dec32, dec64 and dec128 can't)
func NeedCustomUnmarshaler ¶ added in v0.1.1
NeedCustomUnmarshaler checks if given typeName is a native type which needs custom unmarshaler, e.g. $int, $float64, etc
Types ¶
type Bool ¶ added in v0.1.1
type Bool string
Bool represents field of type bool
func (Bool) Register ¶ added in v0.1.1
func (i Bool) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Dec128 ¶
type Dec128 string
Dec128 represents field of type dec128
func (Dec128) Register ¶
func (i Dec128) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Dec32 ¶
type Dec32 string
Dec32 represents field of type dec32
func (Dec32) Register ¶
func (i Dec32) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Dec64 ¶
type Dec64 string
Dec64 represents field of type dec64
func (Dec64) Register ¶
func (i Dec64) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Field ¶
type Field interface {
Name() string
TypeName() string
Register(comment []string, registrator FieldRegistrator)
GoName() string
}
Field represents a field of given type
type FieldCustom ¶
type FieldCustom struct {
FieldName string
Type TypeRegistration
}
FieldCustom represents a field of custom pre-registered type
func (FieldCustom) GoName ¶ added in v0.1.1
func (f FieldCustom) GoName() string
GoName name of registered type
func (FieldCustom) Register ¶
func (f FieldCustom) Register(comment []string, registrator FieldRegistrator)
Register registers custom type
type FieldRegistrator ¶
type FieldRegistrator interface {
AddInt(comment []string, name string)
AddInt8(comment []string, name string)
AddInt16(comment []string, name string)
AddInt32(comment []string, name string)
AddInt64(comment []string, name string)
AddUint(comment []string, name string)
AddUint8(comment []string, name string)
AddUint16(comment []string, name string)
AddUint32(comment []string, name string)
AddUint64(comment []string, name string)
AddDec128(comment []string, name string)
AddFloat32(comment []string, name string)
AddFloat64(comment []string, name string)
AddString(comment []string, name string)
AddStr(comment []string, name string)
AddBool(comment []string, name string)
AddCustomType(comment []string, name string, info TypeRegistration)
}
FieldRegistrator abstration for field of given type adder
type Float32 ¶
type Float32 string
Float32 represents field of type float32
func (Float32) Register ¶
func (i Float32) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Float64 ¶
type Float64 string
Float64 represents field of type float64
func (Float64) Register ¶
func (i Float64) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Hex ¶
type Hex string
Hex represents field of type hex
func (Hex) Register ¶
func (i Hex) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Hex16 ¶
type Hex16 string
Hex16 represents field of type hex16
func (Hex16) Register ¶
func (i Hex16) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Hex32 ¶
type Hex32 string
Hex32 represents field of type hex32
func (Hex32) Register ¶
func (i Hex32) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Hex64 ¶
type Hex64 string
Hex64 represents field of type hex64
func (Hex64) Register ¶
func (i Hex64) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Hex8 ¶
type Hex8 string
Hex8 represents field of type hex8
func (Hex8) Register ¶
func (i Hex8) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type ImportedType ¶
ImportedType imported type view
func (ImportedType) String ¶
func (it ImportedType) String() string
type Int ¶
type Int string
Int represents field of type int
func (Int) Register ¶
func (i Int) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Int16 ¶
type Int16 string
Int16 represents field of type int16
func (Int16) Register ¶
func (i Int16) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Int32 ¶
type Int32 string
Int32 represents field of type int32
func (Int32) Register ¶
func (i Int32) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Int64 ¶
type Int64 string
Int64 represents field of type int64
func (Int64) Register ¶
func (i Int64) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Int8 ¶
type Int8 string
Int8 represents field of type int8
func (Int8) Register ¶
func (i Int8) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Oct ¶
type Oct string
Oct represents field of type oct
func (Oct) Register ¶
func (i Oct) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Oct16 ¶
type Oct16 string
Oct16 represents field of type oct16
func (Oct16) Register ¶
func (i Oct16) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Oct32 ¶
type Oct32 string
Oct32 represents field of type oct32
func (Oct32) Register ¶
func (i Oct32) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Oct64 ¶
type Oct64 string
Oct64 represents field of type oct64
func (Oct64) Register ¶
func (i Oct64) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Oct8 ¶
type Oct8 string
Oct8 represents field of type oct8
func (Oct8) Register ¶
func (i Oct8) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Str ¶
type Str string
Str represents field of type str
func (Str) Register ¶
func (i Str) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type String ¶
type String string
String represents field of type string
func (String) Register ¶
func (i String) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type TypeRegistration ¶
type TypeRegistration interface {
String() string
// contains filtered or unexported methods
}
TypeRegistration type registration view
type Uint ¶
type Uint string
Uint represents field of type uint
func (Uint) Register ¶
func (i Uint) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Uint16 ¶
type Uint16 string
Uint16 represents field of type uint16
func (Uint16) Register ¶
func (i Uint16) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Uint32 ¶
type Uint32 string
Uint32 represents field of type uint32
func (Uint32) Register ¶
func (i Uint32) Register(comment []string, registrator FieldRegistrator)
Register registers a field
type Uint64 ¶
type Uint64 string
Uint64 represents field of type uint64
func (Uint64) Register ¶
func (i Uint64) Register(comment []string, registrator FieldRegistrator)
Register registers a field
Source Files
¶
- builtin.go
- field.go
- fields_generator.go
- gen_bool.go
- gen_dec128.go
- gen_dec32.go
- gen_dec64.go
- gen_float32.go
- gen_float64.go
- gen_hex.go
- gen_hex16.go
- gen_hex32.go
- gen_hex64.go
- gen_hex8.go
- gen_int.go
- gen_int16.go
- gen_int32.go
- gen_int64.go
- gen_int8.go
- gen_oct.go
- gen_oct16.go
- gen_oct32.go
- gen_oct64.go
- gen_oct8.go
- gen_str.go
- gen_string.go
- gen_uint.go
- gen_uint16.go
- gen_uint32.go
- gen_uint64.go
- gen_uint8.go
- type_custom.go
- type_imported.go
- type_local.go
- type_registration.go