Documentation ¶
Index ¶
- func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
- func Logger(inner http.Handler, name string) http.Handler
- func NewRouter(routers ...Router) *mux.Router
- func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error)
- func ReadFormFilesToTempFiles(r *http.Request, key string) ([]*os.File, error)
- type Burnrate
- type ImplResponse
- type Indicator
- type IndicatorLatency
- type IndicatorRatio
- type MultiBurnrateAlert
- type Objective
- type ObjectiveStatus
- type ObjectiveStatusAvailability
- type ObjectiveStatusBudget
- type ObjectivesApiController
- func (c *ObjectivesApiController) GetMultiBurnrateAlerts(w http.ResponseWriter, r *http.Request)
- func (c *ObjectivesApiController) GetObjectiveErrorBudget(w http.ResponseWriter, r *http.Request)
- func (c *ObjectivesApiController) GetObjectiveStatus(w http.ResponseWriter, r *http.Request)
- func (c *ObjectivesApiController) GetREDErrors(w http.ResponseWriter, r *http.Request)
- func (c *ObjectivesApiController) GetREDRequests(w http.ResponseWriter, r *http.Request)
- func (c *ObjectivesApiController) ListObjectives(w http.ResponseWriter, r *http.Request)
- func (c *ObjectivesApiController) Routes() Routes
- type ObjectivesApiRouter
- type ObjectivesApiService
- func (s *ObjectivesApiService) GetMultiBurnrateAlerts(ctx context.Context, expr string, grouping string) (ImplResponse, error)
- func (s *ObjectivesApiService) GetObjectiveErrorBudget(ctx context.Context, expr string, grouping string, start int32, end int32) (ImplResponse, error)
- func (s *ObjectivesApiService) GetObjectiveStatus(ctx context.Context, expr string, grouping string) (ImplResponse, error)
- func (s *ObjectivesApiService) GetREDErrors(ctx context.Context, expr string, grouping string, start int32, end int32) (ImplResponse, error)
- func (s *ObjectivesApiService) GetREDRequests(ctx context.Context, expr string, grouping string, start int32, end int32) (ImplResponse, error)
- func (s *ObjectivesApiService) ListObjectives(ctx context.Context, expr string) (ImplResponse, error)
- type ObjectivesApiServicer
- type Query
- type QueryMatchers
- type QueryRange
- type Route
- type Router
- type Routes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeJSONResponse ¶
func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error
EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code
func ReadFormFileToTempFile ¶
ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file
Types ¶
type ImplResponse ¶
type ImplResponse struct { Code int Body interface{} }
Implementation response defines an error code with the associated body
func Response ¶
func Response(code int, body interface{}) ImplResponse
Response return a ImplResponse struct filled
type Indicator ¶
type Indicator struct { Ratio IndicatorRatio `json:"ratio,omitempty"` Latency IndicatorLatency `json:"latency,omitempty"` }
type IndicatorLatency ¶
type IndicatorRatio ¶
type MultiBurnrateAlert ¶
type ObjectiveStatus ¶
type ObjectiveStatus struct { Labels map[string]string `json:"labels,omitempty"` Availability ObjectiveStatusAvailability `json:"availability"` Budget ObjectiveStatusBudget `json:"budget"` }
type ObjectiveStatusBudget ¶
type ObjectivesApiController ¶
type ObjectivesApiController struct {
// contains filtered or unexported fields
}
A ObjectivesApiController binds http requests to an api service and writes the service results to the http response
func (*ObjectivesApiController) GetMultiBurnrateAlerts ¶
func (c *ObjectivesApiController) GetMultiBurnrateAlerts(w http.ResponseWriter, r *http.Request)
GetMultiBurnrateAlerts - Get the MultiBurnrateAlerts for the Objective
func (*ObjectivesApiController) GetObjectiveErrorBudget ¶
func (c *ObjectivesApiController) GetObjectiveErrorBudget(w http.ResponseWriter, r *http.Request)
GetObjectiveErrorBudget - Get ErrorBudget graph sample pairs
func (*ObjectivesApiController) GetObjectiveStatus ¶
func (c *ObjectivesApiController) GetObjectiveStatus(w http.ResponseWriter, r *http.Request)
GetObjectiveStatus - Get objective status
func (*ObjectivesApiController) GetREDErrors ¶
func (c *ObjectivesApiController) GetREDErrors(w http.ResponseWriter, r *http.Request)
GetREDErrors - Get a matrix of error percentage by label
func (*ObjectivesApiController) GetREDRequests ¶
func (c *ObjectivesApiController) GetREDRequests(w http.ResponseWriter, r *http.Request)
GetREDRequests - Get a matrix of requests by label
func (*ObjectivesApiController) ListObjectives ¶
func (c *ObjectivesApiController) ListObjectives(w http.ResponseWriter, r *http.Request)
ListObjectives - List Objectives
func (*ObjectivesApiController) Routes ¶
func (c *ObjectivesApiController) Routes() Routes
Routes returns all of the api route for the ObjectivesApiController
type ObjectivesApiRouter ¶
type ObjectivesApiRouter interface { GetMultiBurnrateAlerts(http.ResponseWriter, *http.Request) GetObjectiveErrorBudget(http.ResponseWriter, *http.Request) GetObjectiveStatus(http.ResponseWriter, *http.Request) GetREDErrors(http.ResponseWriter, *http.Request) GetREDRequests(http.ResponseWriter, *http.Request) ListObjectives(http.ResponseWriter, *http.Request) }
ObjectivesApiRouter defines the required methods for binding the api requests to a responses for the ObjectivesApi The ObjectivesApiRouter implementation should parse necessary information from the http request, pass the data to a ObjectivesApiServicer to perform the required actions, then write the service results to the http response.
type ObjectivesApiService ¶
type ObjectivesApiService struct { }
ObjectivesApiService is a service that implents the logic for the ObjectivesApiServicer This service should implement the business logic for every endpoint for the ObjectivesApi API. Include any external packages or services that will be required by this service.
func (*ObjectivesApiService) GetMultiBurnrateAlerts ¶
func (s *ObjectivesApiService) GetMultiBurnrateAlerts(ctx context.Context, expr string, grouping string) (ImplResponse, error)
GetMultiBurnrateAlerts - Get the MultiBurnrateAlerts for the Objective
func (*ObjectivesApiService) GetObjectiveErrorBudget ¶
func (s *ObjectivesApiService) GetObjectiveErrorBudget(ctx context.Context, expr string, grouping string, start int32, end int32) (ImplResponse, error)
GetObjectiveErrorBudget - Get ErrorBudget graph sample pairs
func (*ObjectivesApiService) GetObjectiveStatus ¶
func (s *ObjectivesApiService) GetObjectiveStatus(ctx context.Context, expr string, grouping string) (ImplResponse, error)
GetObjectiveStatus - Get objective status
func (*ObjectivesApiService) GetREDErrors ¶
func (s *ObjectivesApiService) GetREDErrors(ctx context.Context, expr string, grouping string, start int32, end int32) (ImplResponse, error)
GetREDErrors - Get a matrix of error percentage by label
func (*ObjectivesApiService) GetREDRequests ¶
func (s *ObjectivesApiService) GetREDRequests(ctx context.Context, expr string, grouping string, start int32, end int32) (ImplResponse, error)
GetREDRequests - Get a matrix of requests by label
func (*ObjectivesApiService) ListObjectives ¶
func (s *ObjectivesApiService) ListObjectives(ctx context.Context, expr string) (ImplResponse, error)
ListObjectives - List Objectives
type ObjectivesApiServicer ¶
type ObjectivesApiServicer interface { GetMultiBurnrateAlerts(context.Context, string, string) (ImplResponse, error) GetObjectiveErrorBudget(context.Context, string, string, int32, int32) (ImplResponse, error) GetObjectiveStatus(context.Context, string, string) (ImplResponse, error) GetREDErrors(context.Context, string, string, int32, int32) (ImplResponse, error) GetREDRequests(context.Context, string, string, int32, int32) (ImplResponse, error) ListObjectives(context.Context, string) (ImplResponse, error) }
ObjectivesApiServicer defines the api actions for the ObjectivesApi service This interface intended to stay up to date with the openapi yaml used to generate it, while the service implementation can ignored with the .openapi-generator-ignore file and updated with the logic required for the API.
func NewObjectivesApiService ¶
func NewObjectivesApiService() ObjectivesApiServicer
NewObjectivesApiService creates a default api service
type Query ¶
type Query struct { Metric string `json:"metric"` Name string `json:"name,omitempty"` Matchers []QueryMatchers `json:"matchers,omitempty"` }
type QueryMatchers ¶
type QueryRange ¶
type Route ¶
type Route struct { Name string Method string Pattern string HandlerFunc http.HandlerFunc }
A Route defines the parameters for an api endpoint
type Router ¶
type Router interface {
Routes() Routes
}
Router defines the required methods for retrieving api routes
func NewObjectivesApiController ¶
func NewObjectivesApiController(s ObjectivesApiServicer) Router
NewObjectivesApiController creates a default api controller
Source Files ¶
- api.go
- api_objectives.go
- api_objectives_service.go
- helpers.go
- impl.go
- logger.go
- model_burnrate.go
- model_indicator.go
- model_indicator_latency.go
- model_indicator_ratio.go
- model_multi_burnrate_alert.go
- model_objective.go
- model_objective_status.go
- model_objective_status_availability.go
- model_objective_status_budget.go
- model_query.go
- model_query_matchers.go
- model_query_range.go
- routers.go