API version checking and linting.

This commit is contained in:
2020-12-23 19:31:09 +05:00
parent 045769a292
commit 095aff540e
6 changed files with 46 additions and 29 deletions

View File

@@ -2,16 +2,16 @@ package models
// Metric is a generic metric structure.
type Metric struct {
// Metric name.
// Name is a metric name.
Name string
// HELP data, if present.
// Description is a metric description from HELP line.
Description string
// Additional parameters, data inside "{}".
Params []string
// Type is a metric type.
// Type is a metric type from TYPE line.
Type string
// Metric value.
// Value is a metric value.
Value string
// Params is an additional params which are placed inside "{}".
Params []string
}
// NewMetric creates new structure for storing single metric data.
@@ -21,6 +21,7 @@ func NewMetric(name, mType, description string, params []string) Metric {
Description: description,
Type: mType,
Params: params,
Value: "",
}
return m

View File

@@ -2,8 +2,8 @@ package models
// RequestInfo is a parsed request information to throw into application's handler.
type RequestInfo struct {
ApiVersion int
Application string
Metric string
RequestType string
APIVersion int
}