Skip to content

shaodan/kapacitor-client

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Kapacitor Client Module

This package is forked from official client repo I just make it compatible with GoModule.

Install

NOTE: You DON'T need manually install this package if GO111MODULE=on.

go get github.com/shaodan/kapacitor-client

Usage

import (
	"fmt"
	"log"

	client "github.com/shaodan/kapacitor-client"
)

k, err := client.New(client.Config{
	URL:                fmt.Sprintf("http://%s:%d", kapacitorHost, kapacitorPort),
	Timeout:            time.Second * time.Duration(kapacitorTimeout),
	InsecureSkipVerify: kapacitorSSL,
})

if err != nil {
	log.Fatal("Unable to connect Kapacitor %s", err)
}

rtt, version, err = k.Ping()

if err != nil {
     log.Println(err)
}

log.Printf("Connected to Kapacitor %s: %dms", version, rtt/time.Millisecond)

Docs

About

Kapacitor client package compatible with GoModule

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages