Documentation
¶
Overview ¶
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Package api Code generated by swaggo/swag. DO NOT EDIT
Copyright (C) NHR@FAU, University Erlangen-Nuremberg. All rights reserved. Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
Index ¶
- Variables
- func MountRoutes(r *http.ServeMux)
- func ReceiveNats(conf *config.NatsConfig, ms *memorystore.MemoryStore, workers int, ...) error
- func ReceiveRaw(ctx context.Context, listener net.Listener, ...) error
- type ApiMetricData
- type ApiQuery
- type ApiQueryRequest
- type ApiQueryResponse
- type ErrorResponse
Constants ¶
This section is empty.
Variables ¶
var SwaggerInfo = &swag.Spec{ Version: "1.0.0", Host: "localhost:8082", BasePath: "/api/", Schemes: []string{}, Title: "cc-metric-store REST API", Description: "API for cc-metric-store", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, LeftDelim: "{{", RightDelim: "}}", }
SwaggerInfo holds exported Swagger Info so clients can modify it
Functions ¶
func MountRoutes ¶
func ReceiveNats ¶
func ReceiveNats(conf *config.NatsConfig, ms *memorystore.MemoryStore, workers int, ctx context.Context, ) error
Connect to a nats server and subscribe to "updates". This is a blocking function. handleLine will be called for each line recieved via nats. Send `true` through the done channel for gracefull termination.
Types ¶
type ApiMetricData ¶
type ApiMetricData struct {
Error *string `json:"error,omitempty"`
Data util.FloatArray `json:"data,omitempty"`
From int64 `json:"from"`
To int64 `json:"to"`
Resolution int64 `json:"resolution"`
Avg util.Float `json:"avg"`
Min util.Float `json:"min"`
Max util.Float `json:"max"`
}
func (*ApiMetricData) AddStats ¶
func (data *ApiMetricData) AddStats()
TODO: Optimize this, just like the stats endpoint!
func (*ApiMetricData) PadDataWithNull ¶
func (data *ApiMetricData) PadDataWithNull(ms *memorystore.MemoryStore, from, to int64, metric string)
func (*ApiMetricData) ScaleBy ¶
func (data *ApiMetricData) ScaleBy(f util.Float)
type ApiQuery ¶
type ApiQuery struct {
Type *string `json:"type,omitempty"`
SubType *string `json:"subtype,omitempty"`
Metric string `json:"metric"`
Hostname string `json:"host"`
Resolution int64 `json:"resolution"`
TypeIds []string `json:"type-ids,omitempty"`
SubTypeIds []string `json:"subtype-ids,omitempty"`
ScaleFactor util.Float `json:"scale-by,omitempty"`
Aggregate bool `json:"aggreg"`
}
type ApiQueryRequest ¶
type ApiQueryResponse ¶
type ApiQueryResponse struct {
Queries []ApiQuery `json:"queries,omitempty"`
Results [][]ApiMetricData `json:"results"`
}
type ErrorResponse ¶
type ErrorResponse struct {
// Statustext of Errorcode
Status string `json:"status"`
Error string `json:"error"` // Error Message
}
ErrorResponse model