diff options
| author | Shulhan <ms@kilabit.info> | 2022-08-17 14:41:39 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2022-08-17 14:41:39 +0700 |
| commit | a3ea0c7bda6cae7a88af7dd005cd52ac40d42e57 (patch) | |
| tree | 4733d2ced445af2e87b173207e35c245cf8da32c /influxd_client.go | |
| parent | c28879b9d5f2f1bea96d5aaf64f1af1fc185e7b0 (diff) | |
| download | haminer-a3ea0c7bda6cae7a88af7dd005cd52ac40d42e57.tar.xz | |
all: make the forwarders configuration fields to be generic
Instead of single forwarder, Influxd, the Config struct now can have
one or more forwarders.
The kind of forwarders is defined by it subsection name, for example
`[forwarder "influxd"]` defined a forwarder for influxd.
Diffstat (limited to 'influxd_client.go')
| -rw-r--r-- | influxd_client.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/influxd_client.go b/influxd_client.go index 9c71523..7c8a54a 100644 --- a/influxd_client.go +++ b/influxd_client.go @@ -54,6 +54,10 @@ type InfluxdClient struct { // NewInfluxdClient will create, initialize, and return new Influxd client. func NewInfluxdClient(cfg *ConfigForwarder) (cl *InfluxdClient) { + if len(cfg.Url) == 0 { + return nil + } + cl = &InfluxdClient{ cfg: cfg, } |
