openapiutils

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2018 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetHostFromURL added in v0.1.5

func GetHostFromURL(url string) string

GetHostFromURL returns the fqdn of a given string (localhost including port number is also handled). Example domains that would match: - http://domain.com/ - domain.com/parameter - domain.com?anything - example.domain.com - example.domain-hyphen.com - www.domain.com - localhost - localhost:8080 Example domains that would not match: - http://domain.com:8080 (this use case is not support at the moment, it is assumed that actual domains will use standard ports)

Types

type HeaderConfigurations

type HeaderConfigurations map[string]spec.Parameter

HeaderConfigurations defines the header configurations that on runtime will be used by the resource factory to lookup which headers should be passed along with the request

func GetAllHeaderParameters

func GetAllHeaderParameters(spec *spec.Swagger) HeaderConfigurations

GetAllHeaderParameters gets all the parameters of type headers present in the swagger file and returns the header configurations. Currently only the following parameters are supported: - root level parameters (not supported) - path level parameters (not supported) - operation level parameters (supported)

func GetHeaderConfigurations

func GetHeaderConfigurations(parameters []spec.Parameter) HeaderConfigurations

GetHeaderConfigurations gets all the header configurations for a specific

func GetHeaderConfigurationsForParameterGroups

func GetHeaderConfigurationsForParameterGroups(parametersGroup parameterGroups) HeaderConfigurations

GetHeaderConfigurationsForParameterGroups loops through the provided parametersGroup (collection of parameters per operation) and returns a map containing all the header configurations; the key will either be the value specified in the extTfHeader or if not present the default value will be the name of the header. In any case, the key name will be translated to a terraform compliant field name if needed (more details in convertToTerraformCompliantFieldName method)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL