summaryrefslogtreecommitdiffstats
path: root/src/go/collectors/go.d.plugin/modules/geth/init.go
blob: 9b649f859d401eea6903978b75906f8e698b91a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package geth

import (
	"errors"

	"github.com/netdata/netdata/go/go.d.plugin/pkg/prometheus"
	"github.com/netdata/netdata/go/go.d.plugin/pkg/web"
)

func (g *Geth) validateConfig() error {
	if g.URL == "" {
		return errors.New("url not set")
	}
	return nil
}

func (g *Geth) initPrometheusClient() (prometheus.Prometheus, error) {
	client, err := web.NewHTTPClient(g.Client)
	if err != nil {
		return nil, err
	}

	return prometheus.New(client, g.Request), nil
}