Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Endpoint ¶
type Endpoint struct { Methods []string `json:"methods"` Parameters Parameters `json:"parameters"` Args json.RawMessage `json:"args"` }
type Parameter ¶
type Parameter struct { // Type among ["", "string", "array", "object", "boolean", "integer", ] Type string `json:"type"` // Format can be ["uri", ] Format string `json:"format"` Pattern string `json:"pattern"` Default any `json:"default"` Required bool `json:"required"` // Metadata may be empty Title string `json:"title"` Description string `json:"description"` // Integer constraints Minimum int `json:"minimum"` Maximum int `json:"maximum"` // String constraints MinLength int `json:"minLength"` MaxLength int `json:"maxLength"` // List of accepted values Enum []string `json:"enum"` OneOf []Parameter `json:"oneOf"` // todo: items // Maximum length of Items MaxItems int `json:"maxItems"` }
type Parameters ¶
type Specification ¶
type Specification struct { Name string `json:"name"` Description string `json:"description"` URL string `json:"url"` Home string `json:"home"` GmtOffset int `json:"gmt_offset"` TimezoneString string `json:"timezone_string"` Namespaces []string `json:"namespaces"` Authentication []interface{} `json:"authentication"` Routes map[string]Route `json:"routes"` }
func ParseSpecification ¶
func ParseSpecification(content []byte) (*Specification, error)
type URLRequest ¶
type URLRequest struct { URL string `json:"url"` Method string `json:"method"` Body string `json:"body"` Headers map[string]string `json:"headers"` Builtin bool `json:"builtin"` }
func ParseEndpoints ¶
func ParseEndpoints(api *Specification) (endpoints []URLRequest, error error)
Click to show internal directories.
Click to hide internal directories.