api

package
v0.0.0-...-5a001f1 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

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

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)

Jump to

Keyboard shortcuts

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