chore: update to go1.19.1 (#11776)
This commit is contained in:
parent
e46f90e89c
commit
8c49ddccc3
|
|
@ -8,7 +8,7 @@ executors:
|
||||||
working_directory: '/go/src/github.com/influxdata/telegraf'
|
working_directory: '/go/src/github.com/influxdata/telegraf'
|
||||||
resource_class: large
|
resource_class: large
|
||||||
docker:
|
docker:
|
||||||
- image: 'quay.io/influxdb/telegraf-ci:1.18.5'
|
- image: 'quay.io/influxdb/telegraf-ci:1.19.1'
|
||||||
environment:
|
environment:
|
||||||
GOFLAGS: -p=4
|
GOFLAGS: -p=4
|
||||||
mac:
|
mac:
|
||||||
|
|
|
||||||
4
Makefile
4
Makefile
|
|
@ -242,8 +242,8 @@ plugins/parsers/influx/machine.go: plugins/parsers/influx/machine.go.rl
|
||||||
|
|
||||||
.PHONY: ci
|
.PHONY: ci
|
||||||
ci:
|
ci:
|
||||||
docker build -t quay.io/influxdb/telegraf-ci:1.18.5 - < scripts/ci.docker
|
docker build -t quay.io/influxdb/telegraf-ci:1.19.1 - < scripts/ci.docker
|
||||||
docker push quay.io/influxdb/telegraf-ci:1.18.5
|
docker push quay.io/influxdb/telegraf-ci:1.19.1
|
||||||
|
|
||||||
.PHONY: install
|
.PHONY: install
|
||||||
install: $(buildbin)
|
install: $(buildbin)
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ type inputUnit struct {
|
||||||
// ______ ┌───────────┐ ______
|
// ______ ┌───────────┐ ______
|
||||||
// ()_____)──▶ │ Processor │──▶ ()_____)
|
// ()_____)──▶ │ Processor │──▶ ()_____)
|
||||||
// └───────────┘
|
// └───────────┘
|
||||||
|
|
||||||
type processorUnit struct {
|
type processorUnit struct {
|
||||||
src <-chan telegraf.Metric
|
src <-chan telegraf.Metric
|
||||||
dst chan<- telegraf.Metric
|
dst chan<- telegraf.Metric
|
||||||
|
|
@ -59,7 +60,7 @@ type processorUnit struct {
|
||||||
// aggregatorUnit is a group of Aggregators and their source and sink channels.
|
// aggregatorUnit is a group of Aggregators and their source and sink channels.
|
||||||
// Typically the aggregators write to a processor channel and pass the original
|
// Typically the aggregators write to a processor channel and pass the original
|
||||||
// metrics to the output channel. The sink channels may be the same channel.
|
// metrics to the output channel. The sink channels may be the same channel.
|
||||||
//
|
|
||||||
// ┌────────────┐
|
// ┌────────────┐
|
||||||
// ┌──▶ │ Aggregator │───┐
|
// ┌──▶ │ Aggregator │───┐
|
||||||
// │ └────────────┘ │
|
// │ └────────────┘ │
|
||||||
|
|
@ -71,6 +72,7 @@ type processorUnit struct {
|
||||||
// │ └────────────┘
|
// │ └────────────┘
|
||||||
// │ ______
|
// │ ______
|
||||||
// └────────────────────────▶ ()_____)
|
// └────────────────────────▶ ()_____)
|
||||||
|
|
||||||
type aggregatorUnit struct {
|
type aggregatorUnit struct {
|
||||||
src <-chan telegraf.Metric
|
src <-chan telegraf.Metric
|
||||||
aggC chan<- telegraf.Metric
|
aggC chan<- telegraf.Metric
|
||||||
|
|
@ -80,7 +82,7 @@ type aggregatorUnit struct {
|
||||||
|
|
||||||
// outputUnit is a group of Outputs and their source channel. Metrics on the
|
// outputUnit is a group of Outputs and their source channel. Metrics on the
|
||||||
// channel are written to all outputs.
|
// channel are written to all outputs.
|
||||||
//
|
|
||||||
// ┌────────┐
|
// ┌────────┐
|
||||||
// ┌──▶ │ Output │
|
// ┌──▶ │ Output │
|
||||||
// │ └────────┘
|
// │ └────────┘
|
||||||
|
|
@ -90,6 +92,7 @@ type aggregatorUnit struct {
|
||||||
// │ ┌────────┐
|
// │ ┌────────┐
|
||||||
// └──▶ │ Output │
|
// └──▶ │ Output │
|
||||||
// └────────┘
|
// └────────┘
|
||||||
|
|
||||||
type outputUnit struct {
|
type outputUnit struct {
|
||||||
src <-chan telegraf.Metric
|
src <-chan telegraf.Metric
|
||||||
outputs []*models.RunningOutput
|
outputs []*models.RunningOutput
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ var globalTagsConfig = `
|
||||||
`
|
`
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the agentConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the agentConfig data.
|
||||||
|
//
|
||||||
//go:embed agent.conf
|
//go:embed agent.conf
|
||||||
var agentConfig string
|
var agentConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,11 +14,10 @@ type Filter interface {
|
||||||
// for matching a given string against the filter list. The filter list
|
// for matching a given string against the filter list. The filter list
|
||||||
// supports glob matching too, ie:
|
// supports glob matching too, ie:
|
||||||
//
|
//
|
||||||
// f, _ := Compile([]string{"cpu", "mem", "net*"})
|
// f, _ := Compile([]string{"cpu", "mem", "net*"})
|
||||||
// f.Match("cpu") // true
|
// f.Match("cpu") // true
|
||||||
// f.Match("network") // true
|
// f.Match("network") // true
|
||||||
// f.Match("memory") // false
|
// f.Match("memory") // false
|
||||||
//
|
|
||||||
func Compile(filters []string) (Filter, error) {
|
func Compile(filters []string) (Filter, error) {
|
||||||
// return if there is nothing to compile
|
// return if there is nothing to compile
|
||||||
if len(filters) == 0 {
|
if len(filters) == 0 {
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -1,6 +1,6 @@
|
||||||
module github.com/influxdata/telegraf
|
module github.com/influxdata/telegraf
|
||||||
|
|
||||||
go 1.18
|
go 1.19
|
||||||
|
|
||||||
// Workaround for https://github.com/lxc/lxd/issues/10745 (failing "go list -m all")
|
// Workaround for https://github.com/lxc/lxd/issues/10745 (failing "go list -m all")
|
||||||
replace google.golang.org/grpc/naming => google.golang.org/grpc v1.29.1
|
replace google.golang.org/grpc/naming => google.golang.org/grpc v1.29.1
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ func ClearCache() {
|
||||||
cache = make(map[string]bool)
|
cache = make(map[string]bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
//will give all found folders to gosmi and load in all modules found in the folders
|
// will give all found folders to gosmi and load in all modules found in the folders
|
||||||
func LoadMibsFromPath(paths []string, log telegraf.Logger, loader MibLoader) error {
|
func LoadMibsFromPath(paths []string, log telegraf.Logger, loader MibLoader) error {
|
||||||
folders, err := walkPaths(paths, log)
|
folders, err := walkPaths(paths, log)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -89,7 +89,7 @@ func LoadMibsFromPath(paths []string, log telegraf.Logger, loader MibLoader) err
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//should walk the paths given and find all folders
|
// should walk the paths given and find all folders
|
||||||
func walkPaths(paths []string, log telegraf.Logger) ([]string, error) {
|
func walkPaths(paths []string, log telegraf.Logger) ([]string, error) {
|
||||||
once.Do(gosmi.Init)
|
once.Do(gosmi.Init)
|
||||||
folders := []string{}
|
folders := []string{}
|
||||||
|
|
|
||||||
|
|
@ -105,16 +105,18 @@ type nodes []*node
|
||||||
// less than a non-wildcard value.
|
// less than a non-wildcard value.
|
||||||
//
|
//
|
||||||
// For example, the filters:
|
// For example, the filters:
|
||||||
// "*.*"
|
//
|
||||||
// "servers.*"
|
// "*.*"
|
||||||
// "servers.localhost"
|
// "servers.*"
|
||||||
// "*.localhost"
|
// "servers.localhost"
|
||||||
|
// "*.localhost"
|
||||||
//
|
//
|
||||||
// Would be sorted as:
|
// Would be sorted as:
|
||||||
// "servers.localhost"
|
//
|
||||||
// "servers.*"
|
// "servers.localhost"
|
||||||
// "*.localhost"
|
// "servers.*"
|
||||||
// "*.*"
|
// "*.localhost"
|
||||||
|
// "*.*"
|
||||||
func (n *nodes) Less(j, k int) bool {
|
func (n *nodes) Less(j, k int) bool {
|
||||||
if (*n)[j].value == "*" && (*n)[k].value != "*" {
|
if (*n)[j].value == "*" && (*n)[k].value != "*" {
|
||||||
return false
|
return false
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,16 +22,16 @@ var err error
|
||||||
// However, if you want to do all your config in code, you can like so:
|
// However, if you want to do all your config in code, you can like so:
|
||||||
//
|
//
|
||||||
// // initialize your plugin with any settings you want
|
// // initialize your plugin with any settings you want
|
||||||
// myInput := &mypluginname.MyPlugin{
|
//
|
||||||
// DefaultSettingHere: 3,
|
// myInput := &mypluginname.MyPlugin{
|
||||||
// }
|
// DefaultSettingHere: 3,
|
||||||
|
// }
|
||||||
//
|
//
|
||||||
// shim := shim.New()
|
// shim := shim.New()
|
||||||
//
|
//
|
||||||
// shim.AddInput(myInput)
|
// shim.AddInput(myInput)
|
||||||
//
|
//
|
||||||
// // now the shim.Run() call as below. Note the shim is only intended to run a single plugin.
|
// // now the shim.Run() call as below. Note the shim is only intended to run a single plugin.
|
||||||
//
|
|
||||||
func main() {
|
func main() {
|
||||||
// parse command line options
|
// parse command line options
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
@ -341,7 +342,7 @@ func (s *AliyunCMS) gatherMetric(acc telegraf.Accumulator, metricName string, me
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//tag helper
|
// tag helper
|
||||||
func parseTag(tagSpec string, data interface{}) (tagKey string, tagValue string, err error) {
|
func parseTag(tagSpec string, data interface{}) (tagKey string, tagValue string, err error) {
|
||||||
var (
|
var (
|
||||||
ok bool
|
ok bool
|
||||||
|
|
|
||||||
|
|
@ -52,8 +52,8 @@ type parsedDResp struct {
|
||||||
pageNumber int
|
pageNumber int
|
||||||
}
|
}
|
||||||
|
|
||||||
//getRPCReqFromDiscoveryRequest - utility function to map between aliyun request primitives
|
// getRPCReqFromDiscoveryRequest - utility function to map between aliyun request primitives
|
||||||
//discoveryRequest represents different type of discovery requests
|
// discoveryRequest represents different type of discovery requests
|
||||||
func getRPCReqFromDiscoveryRequest(req discoveryRequest) (*requests.RpcRequest, error) {
|
func getRPCReqFromDiscoveryRequest(req discoveryRequest) (*requests.RpcRequest, error) {
|
||||||
if reflect.ValueOf(req).Type().Kind() != reflect.Ptr ||
|
if reflect.ValueOf(req).Type().Kind() != reflect.Ptr ||
|
||||||
reflect.ValueOf(req).IsNil() {
|
reflect.ValueOf(req).IsNil() {
|
||||||
|
|
@ -80,12 +80,12 @@ func getRPCReqFromDiscoveryRequest(req discoveryRequest) (*requests.RpcRequest,
|
||||||
return nil, errors.Errorf("didn't find *requests.RpcRequest embedded struct in %q", ptrV.Type())
|
return nil, errors.Errorf("didn't find *requests.RpcRequest embedded struct in %q", ptrV.Type())
|
||||||
}
|
}
|
||||||
|
|
||||||
//newDiscoveryTool function returns discovery tool object.
|
// newDiscoveryTool function returns discovery tool object.
|
||||||
//The object is used to periodically get data about aliyun objects and send this
|
// The object is used to periodically get data about aliyun objects and send this
|
||||||
//data into channel. The intention is to enrich reported metrics with discovery data.
|
// data into channel. The intention is to enrich reported metrics with discovery data.
|
||||||
//Discovery is supported for a limited set of object types (defined by project) and can be extended in future.
|
// Discovery is supported for a limited set of object types (defined by project) and can be extended in future.
|
||||||
//Discovery can be limited by region if not set, then all regions is queried.
|
// Discovery can be limited by region if not set, then all regions is queried.
|
||||||
//Request against API can inquire additional costs, consult with aliyun API documentation.
|
// Request against API can inquire additional costs, consult with aliyun API documentation.
|
||||||
func newDiscoveryTool(regions []string, project string, lg telegraf.Logger, credential auth.Credential, rateLimit int, discoveryInterval time.Duration) (*discoveryTool, error) {
|
func newDiscoveryTool(regions []string, project string, lg telegraf.Logger, credential auth.Credential, rateLimit int, discoveryInterval time.Duration) (*discoveryTool, error) {
|
||||||
var (
|
var (
|
||||||
dscReq = map[string]discoveryRequest{}
|
dscReq = map[string]discoveryRequest{}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -114,11 +114,13 @@ func (c jolokiaClientStub) MakeRequest(_ *http.Request) (*http.Response, error)
|
||||||
|
|
||||||
// Generates a pointer to an HttpJson object that uses a mock HTTP client.
|
// Generates a pointer to an HttpJson object that uses a mock HTTP client.
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// response : Body of the response that the mock HTTP client should return
|
//
|
||||||
// statusCode: HTTP status code the mock HTTP client should return
|
// response : Body of the response that the mock HTTP client should return
|
||||||
|
// statusCode: HTTP status code the mock HTTP client should return
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// *HttpJson: Pointer to an HttpJson object that uses the generated mock HTTP client
|
//
|
||||||
|
// *HttpJson: Pointer to an HttpJson object that uses the generated mock HTTP client
|
||||||
func genJolokiaClientStub(response string, statusCode int, servers []string, metrics []string) *Cassandra {
|
func genJolokiaClientStub(response string, statusCode int, servers []string, metrics []string) *Cassandra {
|
||||||
return &Cassandra{
|
return &Cassandra{
|
||||||
jClient: jolokiaClientStub{responseBody: response, statusCode: statusCode},
|
jClient: jolokiaClientStub{responseBody: response, statusCode: statusCode},
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
@ -63,19 +64,19 @@ func (c *Chrony) Gather(acc telegraf.Accumulator) error {
|
||||||
|
|
||||||
// processChronycOutput takes in a string output from the chronyc command, like:
|
// processChronycOutput takes in a string output from the chronyc command, like:
|
||||||
//
|
//
|
||||||
// Reference ID : 192.168.1.22 (ntp.example.com)
|
// Reference ID : 192.168.1.22 (ntp.example.com)
|
||||||
// Stratum : 3
|
// Stratum : 3
|
||||||
// Ref time (UTC) : Thu May 12 14:27:07 2016
|
// Ref time (UTC) : Thu May 12 14:27:07 2016
|
||||||
// System time : 0.000020390 seconds fast of NTP time
|
// System time : 0.000020390 seconds fast of NTP time
|
||||||
// Last offset : +0.000012651 seconds
|
// Last offset : +0.000012651 seconds
|
||||||
// RMS offset : 0.000025577 seconds
|
// RMS offset : 0.000025577 seconds
|
||||||
// Frequency : 16.001 ppm slow
|
// Frequency : 16.001 ppm slow
|
||||||
// Residual freq : -0.000 ppm
|
// Residual freq : -0.000 ppm
|
||||||
// Skew : 0.006 ppm
|
// Skew : 0.006 ppm
|
||||||
// Root delay : 0.001655 seconds
|
// Root delay : 0.001655 seconds
|
||||||
// Root dispersion : 0.003307 seconds
|
// Root dispersion : 0.003307 seconds
|
||||||
// Update interval : 507.2 seconds
|
// Update interval : 507.2 seconds
|
||||||
// Leap status : Normal
|
// Leap status : Normal
|
||||||
//
|
//
|
||||||
// The value on the left side of the colon is used as field name, if the first field on
|
// The value on the left side of the colon is used as field name, if the first field on
|
||||||
// the right side is a float. If it cannot be parsed as float, it is a tag name.
|
// the right side is a float. If it cannot be parsed as float, it is a tag name.
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import (
|
||||||
telemetry "github.com/cisco-ie/nx-telemetry-proto/telemetry_bis"
|
telemetry "github.com/cisco-ie/nx-telemetry-proto/telemetry_bis"
|
||||||
)
|
)
|
||||||
|
|
||||||
//xform Field to string
|
// xform Field to string
|
||||||
func xformValueString(field *telemetry.TelemetryField) string {
|
func xformValueString(field *telemetry.TelemetryField) string {
|
||||||
var str string
|
var str string
|
||||||
switch val := field.ValueByType.(type) {
|
switch val := field.ValueByType.(type) {
|
||||||
|
|
@ -31,7 +31,7 @@ func xformValueString(field *telemetry.TelemetryField) string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
//xform Uint64 to int64
|
// xform Uint64 to int64
|
||||||
func nxosValueXformUint64Toint64(field *telemetry.TelemetryField, value interface{}) interface{} {
|
func nxosValueXformUint64Toint64(field *telemetry.TelemetryField, value interface{}) interface{} {
|
||||||
if field.GetUint64Value() != 0 {
|
if field.GetUint64Value() != 0 {
|
||||||
return int64(value.(uint64))
|
return int64(value.(uint64))
|
||||||
|
|
@ -39,7 +39,7 @@ func nxosValueXformUint64Toint64(field *telemetry.TelemetryField, value interfac
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//xform string to float
|
// xform string to float
|
||||||
func nxosValueXformStringTofloat(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
func nxosValueXformStringTofloat(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
||||||
//convert property to float from string.
|
//convert property to float from string.
|
||||||
vals := field.GetStringValue()
|
vals := field.GetStringValue()
|
||||||
|
|
@ -51,7 +51,7 @@ func nxosValueXformStringTofloat(field *telemetry.TelemetryField, _ interface{})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//xform string to uint64
|
// xform string to uint64
|
||||||
func nxosValueXformStringToUint64(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
func nxosValueXformStringToUint64(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
||||||
//string to uint64
|
//string to uint64
|
||||||
vals := field.GetStringValue()
|
vals := field.GetStringValue()
|
||||||
|
|
@ -63,7 +63,7 @@ func nxosValueXformStringToUint64(field *telemetry.TelemetryField, _ interface{}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//xform string to int64
|
// xform string to int64
|
||||||
func nxosValueXformStringToInt64(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
func nxosValueXformStringToInt64(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
||||||
//string to int64
|
//string to int64
|
||||||
vals := field.GetStringValue()
|
vals := field.GetStringValue()
|
||||||
|
|
@ -75,7 +75,7 @@ func nxosValueXformStringToInt64(field *telemetry.TelemetryField, _ interface{})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//auto-xform float properties
|
// auto-xform float properties
|
||||||
func nxosValueAutoXformFloatProp(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
func nxosValueAutoXformFloatProp(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
||||||
//check if we want auto xformation
|
//check if we want auto xformation
|
||||||
vals := field.GetStringValue()
|
vals := field.GetStringValue()
|
||||||
|
|
@ -87,7 +87,7 @@ func nxosValueAutoXformFloatProp(field *telemetry.TelemetryField, _ interface{})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//xform uint64 to string
|
// xform uint64 to string
|
||||||
func nxosValueXformUint64ToString(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
func nxosValueXformUint64ToString(field *telemetry.TelemetryField, _ interface{}) interface{} {
|
||||||
switch val := field.ValueByType.(type) {
|
switch val := field.ValueByType.(type) {
|
||||||
case *telemetry.TelemetryField_StringValue:
|
case *telemetry.TelemetryField_StringValue:
|
||||||
|
|
@ -100,7 +100,7 @@ func nxosValueXformUint64ToString(field *telemetry.TelemetryField, _ interface{}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//Xform value field.
|
// Xform value field.
|
||||||
func (c *CiscoTelemetryMDT) nxosValueXform(field *telemetry.TelemetryField, value interface{}, path string) interface{} {
|
func (c *CiscoTelemetryMDT) nxosValueXform(field *telemetry.TelemetryField, value interface{}, path string) interface{} {
|
||||||
if strings.ContainsRune(path, ':') {
|
if strings.ContainsRune(path, ':') {
|
||||||
// not NXOS
|
// not NXOS
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -103,14 +103,15 @@ func TestCPUStats(t *testing.T) {
|
||||||
// if the measurement is of the wrong type, or if no matching measurements are found
|
// if the measurement is of the wrong type, or if no matching measurements are found
|
||||||
//
|
//
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// t *testing.T : Testing object to use
|
//
|
||||||
// acc testutil.Accumulator: Accumulator to examine
|
// t *testing.T : Testing object to use
|
||||||
// field string : Name of field to examine
|
// acc testutil.Accumulator: Accumulator to examine
|
||||||
// expectedValue float64 : Value to search for within the measurement
|
// field string : Name of field to examine
|
||||||
// delta float64 : Maximum acceptable distance of an accumulated value
|
// expectedValue float64 : Value to search for within the measurement
|
||||||
// from the expectedValue parameter. Useful when
|
// delta float64 : Maximum acceptable distance of an accumulated value
|
||||||
// floating-point arithmetic imprecision makes looking
|
// from the expectedValue parameter. Useful when
|
||||||
// for an exact match impractical
|
// floating-point arithmetic imprecision makes looking
|
||||||
|
// for an exact match impractical
|
||||||
func assertContainsTaggedFloat(
|
func assertContainsTaggedFloat(
|
||||||
t *testing.T,
|
t *testing.T,
|
||||||
acc *testutil.Accumulator,
|
acc *testutil.Accumulator,
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
@ -53,11 +54,13 @@ type pluginData struct {
|
||||||
|
|
||||||
// parse JSON from fluentd Endpoint
|
// parse JSON from fluentd Endpoint
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// data: unprocessed json received from endpoint
|
//
|
||||||
|
// data: unprocessed json received from endpoint
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// pluginData: slice that contains parsed plugins
|
//
|
||||||
// error: error that may have occurred
|
// pluginData: slice that contains parsed plugins
|
||||||
|
// error: error that may have occurred
|
||||||
func parse(data []byte) (datapointArray []pluginData, err error) {
|
func parse(data []byte) (datapointArray []pluginData, err error) {
|
||||||
var endpointData endpointInfo
|
var endpointData endpointInfo
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
@ -481,7 +482,7 @@ func handlePath(gnmiPath *gnmiLib.Path, tags map[string]string, aliases map[stri
|
||||||
return builder.String(), aliasPath, nil
|
return builder.String(), aliasPath, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//ParsePath from XPath-like string to gNMI path structure
|
// ParsePath from XPath-like string to gNMI path structure
|
||||||
func parsePath(origin string, pathToParse string, target string) (*gnmiLib.Path, error) {
|
func parsePath(origin string, pathToParse string, target string) (*gnmiLib.Path, error) {
|
||||||
gnmiPath, err := xpath.ToGNMIPath(pathToParse)
|
gnmiPath, err := xpath.ToGNMIPath(pathToParse)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
@ -121,12 +122,14 @@ func (h *GrayLog) Gather(acc telegraf.Accumulator) error {
|
||||||
|
|
||||||
// Gathers data from a particular server
|
// Gathers data from a particular server
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// acc : The telegraf Accumulator to use
|
//
|
||||||
// serverURL: endpoint to send request to
|
// acc : The telegraf Accumulator to use
|
||||||
// service : the service being queried
|
// serverURL: endpoint to send request to
|
||||||
|
// service : the service being queried
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// error: Any error that may have occurred
|
//
|
||||||
|
// error: Any error that may have occurred
|
||||||
func (h *GrayLog) gatherServer(
|
func (h *GrayLog) gatherServer(
|
||||||
acc telegraf.Accumulator,
|
acc telegraf.Accumulator,
|
||||||
serverURL string,
|
serverURL string,
|
||||||
|
|
@ -161,11 +164,14 @@ func (h *GrayLog) gatherServer(
|
||||||
|
|
||||||
// Flatten JSON hierarchy to produce field name and field value
|
// Flatten JSON hierarchy to produce field name and field value
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// item: Item map to flatten
|
//
|
||||||
// fields: Map to store generated fields.
|
// item: Item map to flatten
|
||||||
// id: Prefix for top level metric (empty string "")
|
// fields: Map to store generated fields.
|
||||||
|
// id: Prefix for top level metric (empty string "")
|
||||||
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// void
|
//
|
||||||
|
// void
|
||||||
func (h *GrayLog) flatten(item map[string]interface{}, fields map[string]interface{}, id string) {
|
func (h *GrayLog) flatten(item map[string]interface{}, fields map[string]interface{}, id string) {
|
||||||
if id != "" {
|
if id != "" {
|
||||||
id = id + "_"
|
id = id + "_"
|
||||||
|
|
@ -185,11 +191,13 @@ func (h *GrayLog) flatten(item map[string]interface{}, fields map[string]interfa
|
||||||
|
|
||||||
// Sends an HTTP request to the server using the GrayLog object's HTTPClient.
|
// Sends an HTTP request to the server using the GrayLog object's HTTPClient.
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// serverURL: endpoint to send request to
|
//
|
||||||
|
// serverURL: endpoint to send request to
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// string: body of the response
|
//
|
||||||
// error : Any error that may have occurred
|
// string: body of the response
|
||||||
|
// error : Any error that may have occurred
|
||||||
func (h *GrayLog) sendRequest(serverURL string) (string, float64, error) {
|
func (h *GrayLog) sendRequest(serverURL string) (string, float64, error) {
|
||||||
headers := map[string]string{
|
headers := map[string]string{
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
|
|
|
||||||
|
|
@ -128,11 +128,13 @@ func (c *mockHTTPClient) HTTPClient() *http.Client {
|
||||||
|
|
||||||
// Generates a pointer to an HttpJson object that uses a mock HTTP client.
|
// Generates a pointer to an HttpJson object that uses a mock HTTP client.
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// response : Body of the response that the mock HTTP client should return
|
//
|
||||||
// statusCode: HTTP status code the mock HTTP client should return
|
// response : Body of the response that the mock HTTP client should return
|
||||||
|
// statusCode: HTTP status code the mock HTTP client should return
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// *HttpJson: Pointer to an HttpJson object that uses the generated mock HTTP client
|
//
|
||||||
|
// *HttpJson: Pointer to an HttpJson object that uses the generated mock HTTP client
|
||||||
func genMockGrayLog(response string, statusCode int) []*GrayLog {
|
func genMockGrayLog(response string, statusCode int) []*GrayLog {
|
||||||
return []*GrayLog{
|
return []*GrayLog{
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -170,8 +170,8 @@ func TestHaproxyGeneratesMetricsUsingSocket(t *testing.T) {
|
||||||
require.NotEmpty(t, acc.Errors)
|
require.NotEmpty(t, acc.Errors)
|
||||||
}
|
}
|
||||||
|
|
||||||
//When not passing server config, we default to localhost
|
// When not passing server config, we default to localhost
|
||||||
//We just want to make sure we did request stat from localhost
|
// We just want to make sure we did request stat from localhost
|
||||||
func TestHaproxyDefaultGetFromLocalhost(t *testing.T) {
|
func TestHaproxyDefaultGetFromLocalhost(t *testing.T) {
|
||||||
r := &haproxy{}
|
r := &haproxy{}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
@ -94,11 +95,13 @@ func (h *HTTP) SetParserFunc(fn telegraf.ParserFunc) {
|
||||||
|
|
||||||
// Gathers data from a particular URL
|
// Gathers data from a particular URL
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// acc : The telegraf Accumulator to use
|
//
|
||||||
// url : endpoint to send request to
|
// acc : The telegraf Accumulator to use
|
||||||
|
// url : endpoint to send request to
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// error: Any error that may have occurred
|
//
|
||||||
|
// error: Any error that may have occurred
|
||||||
func (h *HTTP) gatherURL(
|
func (h *HTTP) gatherURL(
|
||||||
acc telegraf.Accumulator,
|
acc telegraf.Accumulator,
|
||||||
url string,
|
url string,
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
@ -111,12 +112,14 @@ func (h *HTTPJSON) Gather(acc telegraf.Accumulator) error {
|
||||||
|
|
||||||
// Gathers data from a particular server
|
// Gathers data from a particular server
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// acc : The telegraf Accumulator to use
|
//
|
||||||
// serverURL: endpoint to send request to
|
// acc : The telegraf Accumulator to use
|
||||||
// service : the service being queried
|
// serverURL: endpoint to send request to
|
||||||
|
// service : the service being queried
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// error: Any error that may have occurred
|
//
|
||||||
|
// error: Any error that may have occurred
|
||||||
func (h *HTTPJSON) gatherServer(
|
func (h *HTTPJSON) gatherServer(
|
||||||
acc telegraf.Accumulator,
|
acc telegraf.Accumulator,
|
||||||
serverURL string,
|
serverURL string,
|
||||||
|
|
@ -164,11 +167,13 @@ func (h *HTTPJSON) gatherServer(
|
||||||
// Sends an HTTP request to the server using the HTTPJSON object's HTTPClient.
|
// Sends an HTTP request to the server using the HTTPJSON object's HTTPClient.
|
||||||
// This request can be either a GET or a POST.
|
// This request can be either a GET or a POST.
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// serverURL: endpoint to send request to
|
//
|
||||||
|
// serverURL: endpoint to send request to
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// string: body of the response
|
//
|
||||||
// error : Any error that may have occurred
|
// string: body of the response
|
||||||
|
// error : Any error that may have occurred
|
||||||
func (h *HTTPJSON) sendRequest(serverURL string) (string, float64, error) {
|
func (h *HTTPJSON) sendRequest(serverURL string) (string, float64, error) {
|
||||||
// Prepare URL
|
// Prepare URL
|
||||||
requestURL, err := url.Parse(serverURL)
|
requestURL, err := url.Parse(serverURL)
|
||||||
|
|
|
||||||
|
|
@ -156,11 +156,13 @@ func (c *mockHTTPClient) HTTPClient() *http.Client {
|
||||||
|
|
||||||
// Generates a pointer to an HTTPJSON object that uses a mock HTTP client.
|
// Generates a pointer to an HTTPJSON object that uses a mock HTTP client.
|
||||||
// Parameters:
|
// Parameters:
|
||||||
// response : Body of the response that the mock HTTP client should return
|
//
|
||||||
// statusCode: HTTP status code the mock HTTP client should return
|
// response : Body of the response that the mock HTTP client should return
|
||||||
|
// statusCode: HTTP status code the mock HTTP client should return
|
||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// *HTTPJSON: Pointer to an HTTPJSON object that uses the generated mock HTTP client
|
//
|
||||||
|
// *HTTPJSON: Pointer to an HTTPJSON object that uses the generated mock HTTP client
|
||||||
func genMockHTTPJSON(response string, statusCode int) []*HTTPJSON {
|
func genMockHTTPJSON(response string, statusCode int) []*HTTPJSON {
|
||||||
return []*HTTPJSON{
|
return []*HTTPJSON{
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sampleConfig data.
|
||||||
|
//
|
||||||
//go:embed sample.conf
|
//go:embed sample.conf
|
||||||
var sampleConfig string
|
var sampleConfig string
|
||||||
|
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue