icdh
is a Go client library for NGINX Ingress Controller Deep Service Insight API.
Import the library using:
import "github.com/qba73/icdh"
Create a new client
object by calling icdh.NewClient(baseURL)
client, err := icdh.NewClient("http://localhost:9114")
if err != nil {
// handle err
}
Or create a client with a specific http Client:
myHTTPClient := &http.Client{}
client, err := icdh.NewClient(
"http://localhost:9114",
icdh.WithHTTPClient(myHTTPClient),
)
if err != nil {
// handle error
}
stats, err := client.GetStats(ctx, "my.service.com")
if err != nil {
// handle err
}
stats, err := client.GetTSStats(ctx, "service")
if err != nil {
// handle err
}