Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CamelCase ¶
CamelCase converts strings like "space separated", "dash-separated", "snake_case" to "camelCase" but does not convert "TitleCase" to "camelCase"
func OptionCase ¶
OptionCase converts strings like "space separated", "snake_case", "camelCase", "TitleCase" to "option-case"
Types ¶
type APIDefinitions ¶
type APIDefinitions struct {
Host string
Schemes []string
BasePath string
Methods []APIMethod
StructDefs map[string]StructDef
}
APIDefinitions holds all information about SORACOM API
func LoadAPIDef ¶
func LoadAPIDef(apiDefYAMLFile string) (*APIDefinitions, error)
LoadAPIDef loads API definitions from the specified file
type APIMethod ¶
type APIMethod struct {
Path string
Method string
Use string
Tags []string `yaml:"tags"`
Summary string `yaml:"summary"`
Description string `yaml:"description"`
OperationID string `yaml:"operationId"`
Security []map[string]interface{} `yaml:"security"`
CLI []string `yaml:"x-soracom-cli"`
Parameters []APIParam `yaml:"parameters"`
Responses map[string]APIResponse `yaml:"responses"`
}
APIMethod holds information about an API method
type APIParam ¶
type APIParam struct {
Name string `yaml:"name"`
In string `yaml:"in"`
Required bool `yaml:"required"`
Description string `yaml:"description"`
Type string `yaml:"type"`
Enum []string `yaml:"enum"`
Schema APIParamSchema `yaml:"schema"`
}
APIParam holds information about an API parameter
type APIParamSchema ¶
type APIParamSchema struct {
Type string `yaml:"type"`
Items *APIParamSchema `yaml:"items"`
Ref string `yaml:"$ref"`
}
APIParamSchema holds information about a Schema in an API parameter
type APIResponse ¶
type APIResponse struct {
Schema *APIParamSchema
}
APIResponse holds information about an API response
type StructDef ¶
type StructDef struct {
Properties []StructProperty
References []StructReference
}
StructDef holds all information under /definitions in API definition file
type StructProperty ¶
type StructProperty struct {
Name string
Type string
Format string
Description string
Required bool
}
StructProperty holds information about an entry under /definitions/{StructName}/properties in API definition file
type StructReference ¶
StructReference holds information about a reference from a property in API definition file