aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2022-08-17 01:47:45 +0700
committerShulhan <ms@kilabit.info>2022-08-17 01:47:45 +0700
commitd4d756000a90053bbbd46710daf35c8b20523965 (patch)
tree551b28c4cb9542956c1432dfbed1cd8c6d82523c
parentc0420ca7fb513f8ee8b224f512124819bd2af34e (diff)
downloadhaminer-d4d756000a90053bbbd46710daf35c8b20523965.tar.xz
all: rename influxdb.go to influxd_client.go
-rw-r--r--haminer.go2
-rw-r--r--influxd_client.go (renamed from influxdb.go)20
2 files changed, 11 insertions, 11 deletions
diff --git a/haminer.go b/haminer.go
index 95dfe62..8b0799f 100644
--- a/haminer.go
+++ b/haminer.go
@@ -52,7 +52,7 @@ func (h *Haminer) createForwarder() {
}
var (
- fwder = NewInfluxdbClient(&h.cfg.Influxd)
+ fwder = NewInfluxdClient(&h.cfg.Influxd)
)
h.ff = append(h.ff, fwder)
diff --git a/influxdb.go b/influxd_client.go
index 3868574..639167e 100644
--- a/influxdb.go
+++ b/influxd_client.go
@@ -44,17 +44,17 @@ const (
`bytes_read=%d`
)
-// InfluxdbClient contains HTTP connection for writing logs to Influxdb.
-type InfluxdbClient struct {
+// InfluxdClient contains HTTP connection for writing logs to Influxd.
+type InfluxdClient struct {
conn *http.Client
cfg *InfluxdConfig
hostname string
buf bytes.Buffer
}
-// NewInfluxdbClient will create, initialize, and return new Influxdb client.
-func NewInfluxdbClient(cfg *InfluxdConfig) (cl *InfluxdbClient) {
- cl = &InfluxdbClient{
+// NewInfluxdClient will create, initialize, and return new Influxd client.
+func NewInfluxdClient(cfg *InfluxdConfig) (cl *InfluxdClient) {
+ cl = &InfluxdClient{
cfg: cfg,
}
@@ -64,7 +64,7 @@ func NewInfluxdbClient(cfg *InfluxdConfig) (cl *InfluxdbClient) {
return
}
-func (cl *InfluxdbClient) initHostname() {
+func (cl *InfluxdClient) initHostname() {
var err error
cl.hostname, err = os.Hostname()
@@ -76,7 +76,7 @@ func (cl *InfluxdbClient) initHostname() {
}
}
-func (cl *InfluxdbClient) initConn() {
+func (cl *InfluxdClient) initConn() {
tr := &http.Transport{}
cl.conn = &http.Client{
@@ -85,8 +85,8 @@ func (cl *InfluxdbClient) initConn() {
}
// Forwards implement the Forwarder interface. It will write all logs to
-// Influxdb.
-func (cl *InfluxdbClient) Forwards(halogs []*Halog) {
+// Influxd.
+func (cl *InfluxdClient) Forwards(halogs []*Halog) {
var (
logp = `Forwards`
@@ -141,7 +141,7 @@ func (cl *InfluxdbClient) Forwards(halogs []*Halog) {
fmt.Printf(`%s: response: %d %s\n`, logp, httpRes.StatusCode, rspBody)
}
-func (cl *InfluxdbClient) write(halogs []*Halog) (err error) {
+func (cl *InfluxdClient) write(halogs []*Halog) (err error) {
var (
l *Halog
k string