Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ExceptionForCamelCase = map[string]string{
"id": "ID",
"xprv": "XPrv",
"url": "URL",
}
ExceptionForCamelCase - camel case names exception.
Functions ¶
func GenerateAnyType ¶
GenerateAnyType - root generator function for type.
func GenerateOptionalType ¶
GenerateOptionalType - pointer or null simple type.
Types ¶
type APIReference ¶
type Description ¶
type Description struct {
Name string `json:"name,omitempty"`
Summary string `json:"summary,omitempty"`
Description string `json:"description,omitempty"`
ConstName string `json:"-"` // populated manually, used in templates only
GoComment string `json:"-"` // populated manually, used in templates only
}
func (*Description) ToComment ¶
func (d *Description) ToComment() string
ToComment generates comment for generate code from spec.
type Function ¶
type Function struct {
Description
Params []Type `json:"params"`
Result Type `json:"result"`
}
type Module ¶
type Module struct {
Description
Types []Type `json:"types"`
Functions []Function `json:"functions"`
}
type Type ¶
type Type struct {
Description
Type TypeName `json:"type,omitempty"`
GoType string `json:"-"`
Value string `json:"value"`
RefName string `json:"ref_name,omitempty"`
GenericName string `json:"generic_name,omitempty"`
NumberType string `json:"number_type,omitempty"`
NumberSize int `json:"number_size,omitempty"`
GenericArgs []Type `json:"generic_args,omitempty"`
OptionalInner *Type `json:"optional_inner,omitempty"`
ArrayItem *Type `json:"array_item,omitempty"`
StructFields []Type `json:"struct_fields,omitempty"`
EnumConsts []Type `json:"enum_consts,omitempty"`
EnumTypes []Type `json:"enum_types"`
}
Type description from JSON spec.
type TypeName ¶
type TypeName string
const ( Ref TypeName = "Ref" Optional TypeName = "Optional" String TypeName = "String" Number TypeName = "Number" Value TypeName = "Value" Struct TypeName = "Struct" None TypeName = "None" BigInt TypeName = "BigInt" Boolean TypeName = "Boolean" Array TypeName = "Array" Generic TypeName = "Generic" EnumOfTypes TypeName = "EnumOfTypes" EnumOfConsts TypeName = "EnumOfConsts" )
TypeName different values.
Click to show internal directories.
Click to hide internal directories.