v1

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package v1 provides routing and endpoints for the Custom Pod Autoscaler HTTP REST API version 1. Endpoints implemented as handlers, errors returned as valid JSON.

Index

Constants

View Source
const (
	// RunType api marks the metric gathering/evaluation as running during an API request, which will use the results to scale
	RunType = "api"
	// RunTypeDryRun api marks the metric gathering/evaluation as running during an API request,
	// which will only view the results and not use it for scaling
	RunTypeDryRun = "api_dry_run"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Router          chi.Router
	Config          *config.Config
	Client          resourceclient.Client
	Scaler          scale.Scaler
	GetMetricer     metric.GetMetricer
	GetEvaluationer evaluate.GetEvaluationer
}

API is the Custom Pod Autoscaler REST API, exposing endpoints to retrieve metrics/evaluations

func (*API) Routes

func (api *API) Routes()

Routes sets up routing for the API

type Error

type Error struct {
	Message string `json:"message"`
	Code    int    `json:"code"`
}

Error is an error response from the API, with the status code and an error message

Jump to

Keyboard shortcuts

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