github.com/netdata/go.d.plugin@v0.58.1/modules/cassandra/init.go (about) 1 // SPDX-License-Identifier: GPL-3.0-or-later 2 3 package cassandra 4 5 import ( 6 "errors" 7 8 "github.com/netdata/go.d.plugin/pkg/prometheus" 9 "github.com/netdata/go.d.plugin/pkg/web" 10 ) 11 12 func (c *Cassandra) validateConfig() error { 13 if c.URL == "" { 14 return errors.New("'url' is not set") 15 } 16 return nil 17 } 18 19 func (c *Cassandra) initPrometheusClient() (prometheus.Prometheus, error) { 20 client, err := web.NewHTTPClient(c.Client) 21 if err != nil { 22 return nil, err 23 } 24 return prometheus.New(client, c.Request), nil 25 }