Documentation ¶
Index ¶
- func ConfigureValidator(providers []string, ci types.CloudInfo, logger cloudinfo.Logger) error
- func ValidatePathData(pathParams interface{}) error
- type AttributeResponse
- type Classifier
- type Continent
- type ContinentsDataResponse
- type ContinentsResponse
- type GetAttributeValuesPathParams
- type GetImagesQueryParams
- type GetProviderPathParams
- type GetRegionPathParams
- type GetRegionResp
- type GetServicesPathParams
- type ImagesResponse
- type ProductDetailsResponse
- type ProviderResponse
- type ProvidersResponse
- type RegionsResponse
- type Responder
- type RouteHandler
- type ServiceResponse
- type ServicesResponse
- type VersionsResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureValidator ¶
ConfigureValidator configures the Gin validator with custom validator functions
func ValidatePathData ¶
func ValidatePathData(pathParams interface{}) error
ValidatePathData explicitly calls validation on the parsed path data structs
Types ¶
type AttributeResponse ¶
type AttributeResponse struct { AttributeName string `json:"attributeName"` AttributeValues []float64 `json:"attributeValues"` }
AttributeResponse holds attribute values swagger:model AttributeResponse
type Classifier ¶
type Classifier interface { // Classify classifies the passed in struct based on arbitrary, implementation specific criteria Classify(in interface{}) (interface{}, error) }
Classifier represents a contract to classify passed in structs
func NewErrorClassifier ¶
func NewErrorClassifier() Classifier
NewErrorClassifier returns a reference to a classifier instance
type ContinentsDataResponse ¶
type ContinentsDataResponse []Continent
ContinentsDataResponse holds the list of available continents and regions of a cloud provider swagger:model ContinentsDataResponse
type ContinentsResponse ¶
type ContinentsResponse []string
ContinentsResponse holds the list of available continents swagger:model ContinentsResponse
func NewContinentsResponse ¶
func NewContinentsResponse(continents []string) ContinentsResponse
NewContinentsResponse assembles a new continents response
type GetAttributeValuesPathParams ¶
type GetAttributeValuesPathParams struct { GetRegionPathParams `binding:"required" mapstructure:",squash"` // in:path Attribute string `binding:"required,attribute" json:"attribute"` }
GetAttributeValuesPathParams is a placeholder for the get attribute values route's path parameters swagger:parameters getAttrValues
type GetImagesQueryParams ¶
type GetImagesQueryParams struct { // in:query Gpu string `json:"gpu"` // in:query Cr string `json:"cr"` // in:query Version string `json:"version"` // in:query Os string `json:"os,omitempty"` // in:query PkeVersion string `json:"pkeVersion,omitempty"` // in:query LatestOnly string `json:"latestOnly"` }
GetImagesQueryParams is a placeholder for the get images query parameters swagger:parameters getImages
type GetProviderPathParams ¶
type GetProviderPathParams struct { // in:path Provider string `binding:"required,provider" json:"provider"` }
GetProviderPathParams is a placeholder for the providers related route path parameters swagger:parameters getServices getProvider
type GetRegionPathParams ¶
type GetRegionPathParams struct { GetServicesPathParams `binding:"required" mapstructure:",squash"` // in:path Region string `binding:"required,region" json:"region"` }
GetRegionPathParams is a placeholder for the regions related route path parameters swagger:parameters getRegion getImages getProducts getVersions
type GetRegionResp ¶
type GetRegionResp struct { Id string `json:"id"` Name string `json:"name"` Zones []string `json:"zones"` }
GetRegionResp holds the detailed description of a specific region of a cloud provider swagger:model GetRegionResp
type GetServicesPathParams ¶
type GetServicesPathParams struct { GetProviderPathParams `binding:"required" mapstructure:",squash"` // in:path Service string `binding:"required,service" json:"service"` }
GetServicesPathParams is a placeholder for the services related route path parameters swagger:parameters getRegions getService getContinentsData
type ImagesResponse ¶
ImagesResponse holds the list of available images swagger:model ImagesResponse
type ProductDetailsResponse ¶
type ProductDetailsResponse struct { // Products represents a slice of products for a given provider (VMs with attributes and process) Products []types.ProductDetails `json:"products"` // ScrapingTime represents scraping time for a given provider in milliseconds ScrapingTime string `json:"scrapingTime"` }
ProductDetailsResponse Api object to be mapped to product info response swagger:model ProductDetailsResponse
type ProviderResponse ¶
ProviderResponse is the response used for the requested provider swagger:model ProviderResponse
type ProvidersResponse ¶
ProvidersResponse is the response used for the supported providers swagger:model ProvidersResponse
type RegionsResponse ¶
RegionsResponse holds the list of available regions of a cloud provider swagger:model RegionsResponse
type Responder ¶
type Responder interface { // Respond implements the responding logic / it's intended to be self-contained Respond(ginCtx *gin.Context, err error) }
Responder marks responders
func NewErrorResponder ¶
func NewErrorResponder() Responder
NewErrorResponder configures a new error responder
type RouteHandler ¶
type RouteHandler struct {
// contains filtered or unexported fields
}
RouteHandler configures the REST API routes in the gin router
func NewRouteHandler ¶
func NewRouteHandler(p types.CloudInfo, bi buildinfo.BuildInfo, graphqlHandler http.Handler, log cloudinfo.Logger) *RouteHandler
NewRouteHandler creates a new RouteHandler and returns a reference to it
func (*RouteHandler) ConfigureRoutes ¶
func (r *RouteHandler) ConfigureRoutes(router *gin.Engine, basePath string)
ConfigureRoutes configures the gin engine, defines the rest API for this application
func (*RouteHandler) EnableMetrics ¶
func (r *RouteHandler) EnableMetrics(router *gin.Engine, metricsAddr string)
type ServiceResponse ¶
ServiceResponse holds the list of available services swagger:model ServiceResponse
func NewServiceResponse ¶
func NewServiceResponse(sd types.Service) ServiceResponse
NewServiceResponse assembles a service response
type ServicesResponse ¶
ServicesResponse holds the list of available services swagger:model ServicesResponse
func NewServicesResponse ¶
func NewServicesResponse(sds []types.Service) ServicesResponse
NewServicesResponse assembles a new services respons
type VersionsResponse ¶
type VersionsResponse []types.LocationVersion
VersionsResponse holds the list of available versions swagger:model VersionsResponse