Documentation ¶
Overview ¶
Package apigateway provides swagger for API Gateway.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ANYMethod ¶
type ANYMethod struct { Produces []string `json:"produces"` Parameters []map[string]interface{} `json:"parameters"` Responses map[string]string `json:"responses"` XAmazonAPIGatewayIntegration APIIntegration `json:"x-amazon-apigateway-integration"` }
ANYMethod provides is a part of th API Gateway swagger, it instructs the API to handle any HTTP method on an APIPath
type APIIntegration ¶
type APIIntegration struct { URI string `json:"uri"` Responses map[string]map[string]string `json:"responses"` PassthroughBehavior string `json:"passthroughBehavior"` HTTPMethod string `json:"httpMethod"` CacheNamespace string `json:"cacheNamespace"` CacheKeyParameters []string `json:"cacheKeyParameters"` Type string `json:"type"` TimeoutMs int `json:"timeoutInMillis"` }
APIIntegration provides is a part of th API Gateway swagger
type APIPath ¶
type APIPath struct {
XAmazonAPIGatwayAnyMethod ANYMethod `json:"x-amazon-apigateway-any-method"`
}
APIPath provides is a part of th API Gateway swagger
type Swagger ¶
type Swagger struct { Swagger string `json:"swagger"` Info APIInfo `json:"info"` Host string `json:"host"` BasePath string `json:"basePath"` Schemes []string `json:"schemes"` Paths map[string]APIPath `json:"paths"` XAmazonAPIGatewayBinaryMediaTypes []string `json:"x-amazon-apigateway-binary-media-types"` }
Swagger defines an AWS API Gateway Lambda Proxy swagger definition More info here: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions.html
func NewSwagger ¶
func NewSwagger(cfg *SwaggerConfig) (Swagger, error)
NewSwagger creates a new Swagger struct with some default values
type SwaggerConfig ¶
type SwaggerConfig struct { Title string LambdaURI string CacheNamespace string Version string ResourceTimeoutMs int }
SwaggerConfig holds configuration values for NewSwagger() TODO: Probably want to a more comprehensive field for mapping XAmazonAPIGatewayIntegration values with defaults, etc. For now, "ResourceTimeoutMs" is really XAmazonAPIGatewayIntegration.TimeoutMs which is "timeoutInMillis" in Swagger JSON to AWS.