Documentation ¶
Index ¶
- Constants
- func GetSupportedMIMETypes() []string
- func GetSupportedSecurityTypes() []string
- func HandleAuths(req *http.Request, envMap map[string]string, infoSets [][]SecurityInfo) error
- func HandleCookieParameters(req *http.Request, params []Parameter, input string)
- func HandleHeaderParameters(req *http.Request, params []Parameter, input string)
- func HandlePathParameters(path string, params []Parameter, input string) string
- func HandleQueryParameters(q url.Values, params []Parameter, input string) url.Values
- func IsOpenAPI(data []byte) int
- func Load(source string) (*openapi3.T, error)
- func LoadFromBytes(content []byte) (*openapi3.T, error)
- func MatchFilters(filters []string, operationID string) (bool, error)
- func Run(operationID, defaultHost, args string, t *openapi3.T, envs []string) (string, bool, error)
- type Operation
- type OperationInfo
- type OperationList
- type Parameter
- type SecurityInfo
Constants ¶
const ( ListTool = "list" NoFilter = "<none>" )
const GetSchemaTool = "get-schema"
const RunTool = "run"
Variables ¶
This section is empty.
Functions ¶
func GetSupportedMIMETypes ¶
func GetSupportedMIMETypes() []string
func GetSupportedSecurityTypes ¶
func GetSupportedSecurityTypes() []string
func HandleAuths ¶
HandleAuths will set up the request with the necessary authentication information. A set of sets of SecurityInfo is passed in, where each represents a possible set of security options.
func HandleCookieParameters ¶
HandleCookieParameters extracts each cookie parameter from the input JSON and adds it to the request cookies.
func HandleHeaderParameters ¶
HandleHeaderParameters extracts each header parameter from the input JSON and adds it to the request headers.
func HandlePathParameters ¶
HandlePathParameters extracts each path parameter from the input JSON and replaces its placeholder in the URL path.
func HandleQueryParameters ¶
HandleQueryParameters extracts each query parameter from the input JSON and adds it to the URL query.
Types ¶
type OperationInfo ¶
type OperationInfo struct { Server string `json:"server"` Path string `json:"path"` Method string `json:"method"` BodyContentMIME string `json:"bodyContentMIME"` SecurityInfos [][]SecurityInfo `json:"securityInfos"` QueryParams []Parameter `json:"queryParameters"` PathParams []Parameter `json:"pathParameters"` HeaderParams []Parameter `json:"headerParameters"` CookieParams []Parameter `json:"cookieParameters"` }
type OperationList ¶
type SecurityInfo ¶
type SecurityInfo struct { Name string `json:"name"` // name as defined in the security schemes Type string `json:"type"` // http or apiKey Scheme string `json:"scheme"` // bearer or basic, for type==http APIKeyName string `json:"apiKeyName"` // name of the API key, for type==apiKey In string `json:"in"` // header, query, or cookie, for type==apiKey }
A SecurityInfo represents a security scheme in OpenAPI.
func (SecurityInfo) GetCredentialToolStrings ¶
func (i SecurityInfo) GetCredentialToolStrings(hostname string) []string