Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureValidator ¶
func ConfigureValidator() error
ConfigureValidator configures the Gin validator with custom validator functions
Types ¶
type CloudInfoValidator ¶
type CloudInfoValidator interface { // Validate checks the existence, correctness etc... of the parameters ValidatePathParams(params interface{}) error // ValidateContinents checks the existence of provided continents ValidateContinents(continents []string) error }
CloudInfoValidator contract for validating cloud info data
func NewCloudInfoValidator ¶
func NewCloudInfoValidator(ciCli recommender.CloudInfoSource) CloudInfoValidator
type GetRecommendationParams ¶
type GetRecommendationParams struct { // in:path Provider string `binding:"required,provider" json:"provider"` // in:path Service string `binding:"required,service" json:"service"` // in:path Region string `binding:"required,region" json:"region"` }
GetRecommendationParams is a placeholder for the recommendation route's path parameters swagger:parameters recommendCluster recommendClusterScaleOut
type RecommendationResponse ¶
type RecommendationResponse struct {
recommender.ClusterRecommendationResp
}
RecommendationResponse encapsulates the recommendation response swagger:model recommendationResponse
type RouteHandler ¶
type RouteHandler struct {
// contains filtered or unexported fields
}
RouteHandler struct that wraps the recommender engine
func NewRouteHandler ¶
func NewRouteHandler(engine recommender.ClusterRecommender, info buildinfo.BuildInfo, ciCli recommender.CloudInfoSource, log logur.Logger) *RouteHandler
NewRouteHandler creates a new RouteHandler and returns a reference to it
func (*RouteHandler) ConfigureRoutes ¶
func (r *RouteHandler) ConfigureRoutes(router *gin.Engine)
ConfigureRoutes configures the gin engine, defines the rest API for this application
func (*RouteHandler) EnableAuth ¶
func (r *RouteHandler) EnableAuth(router *gin.Engine, role string, sgnKey string)
EnableAuth enables authentication middleware
func (*RouteHandler) EnableMetrics ¶
func (r *RouteHandler) EnableMetrics(router *gin.Engine, metricsAddr string)
Click to show internal directories.
Click to hide internal directories.