Skip to content

Kapacitor client package compatible with GoModule

Notifications You must be signed in to change notification settings

messari/kapacitor-client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 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/messari/kapacitor-client

Usage

import (
	"fmt"
	"log"

	client "github.com/messari/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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%