Documentation ¶
Index ¶
- Constants
- func GenApis(output string, apiSchemas []ApiSchema) error
- func Walk(v Visitor, n ast.Node)
- type AdditionalProperties
- type ApiDefine
- type ApiInfo
- type ApiMethod
- type ApiPayload
- type ApiPayloadField
- type ApiSchema
- type JsonSchema
- type JsonSchemaType
- type Link
- type PropertiesFormat
- type PropertiesFormatObject
- type Visitor
- type ZeroOneBool
Constants ¶
View Source
const ( ApiMethodGet = "GET" ApiMethodPost = "POST" ApiMethodPut = "PUT" ApiMethodDelete = "DELETE" )
View Source
const ( JsonSchemaTypeArrary = "array" JsonSchemaTypeObject = "object" JsonSchemaTypeBoolean = "boolean" JsonSchemaTypeNumber = "number" JsonSchemaTypeInteger = "integer" JsonSchemaTypeString = "string" JsonSchemaTypeAny = "any" JsonSchemaTypeNull = "null" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AdditionalProperties ¶
type AdditionalProperties struct { Schema *JsonSchema Bool ZeroOneBool }
func (*AdditionalProperties) UnmarshalJSON ¶
func (s *AdditionalProperties) UnmarshalJSON(data []byte) error
type ApiDefine ¶
type ApiDefine struct { Name string Description string APILink string Method ApiMethod Path string RequestPayload []ApiPayload ResponsePayload []ApiPayload }
func NewApiDefine ¶
type ApiInfo ¶
type ApiInfo struct { Allowtoken ZeroOneBool Description string Method ApiMethod Name string Parameters *JsonSchema Returns *JsonSchema Permissions interface{} }
type ApiPayload ¶
type ApiPayload struct { Name string Comment string Type string Fields []ApiPayloadField }
type ApiPayloadField ¶
type ApiSchema ¶
type ApiSchema struct { Children []ApiSchema Info map[ApiMethod]ApiInfo Leaf int Path string Text string }
func ParseSchemaFile ¶
func ParseSchemaFilex ¶
type JsonSchema ¶
type JsonSchema struct { Type JsonSchemaType Optional ZeroOneBool TypeText string Description string Format PropertiesFormat Properties map[string]JsonSchema AdditionalProperties AdditionalProperties Items *JsonSchema Links []*Link `json:"links"` }
type JsonSchemaType ¶
type JsonSchemaType string
type PropertiesFormat ¶
type PropertiesFormat struct { Object map[string]PropertiesFormatObject String string }
func (*PropertiesFormat) UnmarshalJSON ¶
func (p *PropertiesFormat) UnmarshalJSON(data []byte) error
type PropertiesFormatObject ¶
type PropertiesFormatObject struct { Default interface{} DefaultKey interface{} Description string Type JsonSchemaType Enum []interface{} Optional ZeroOneBool }
type Visitor ¶
Visitor Enter method is invoked for each node encountered by Walk. If the result visitor w is not nil, Walk visits each of the children of node with the visitor v, followed by a call of the Exit method.
type ZeroOneBool ¶
type ZeroOneBool bool
func (*ZeroOneBool) UnmarshalJSON ¶
func (s *ZeroOneBool) UnmarshalJSON(data []byte) error
Click to show internal directories.
Click to hide internal directories.