https://github.com/qba73/icdh
Go client library for NGINX Ingress Controller Service Insight API
https://github.com/qba73/icdh
go go-client go-library golang nginx nginx-ingress-controller
Last synced: about 2 months ago
JSON representation
Go client library for NGINX Ingress Controller Service Insight API
- Host: GitHub
- URL: https://github.com/qba73/icdh
- Owner: qba73
- License: apache-2.0
- Created: 2022-11-23T16:19:39.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-21T22:30:22.000Z (over 2 years ago)
- Last Synced: 2025-01-13T19:18:52.891Z (4 months ago)
- Topics: go, go-client, go-library, golang, nginx, nginx-ingress-controller
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/qba73/icdh/actions/workflows/go.yml)


[](https://goreportcard.com/report/github.com/qba73/icdh)
[](https://pkg.go.dev/github.com/qba73/[email protected])# icdh
```icdh``` is a Go client library for [NGINX Ingress Controller Deep Service Insight](https://docs.nginx.com/nginx-ingress-controller/logging-and-monitoring/service-insight/) API.
## Using the Go library
Import the library using:
```go
import "github.com/qba73/icdh"
```## Creating a client
Create a new ```client``` object by calling ```icdh.NewClient(baseURL)```
```go
client, err := icdh.NewClient("http://localhost:9114")
if err != nil {
// handle err
}
```Or create a client with a specific http Client:
```go
myHTTPClient := &http.Client{}client, err := icdh.NewClient(
"http://localhost:9114",
icdh.WithHTTPClient(myHTTPClient),
)
if err != nil {
// handle error
}
```## Retrieve statistics for host `my.service.com`
```go
stats, err := client.GetStats(ctx, "my.service.com")
if err != nil {
// handle err
}
```## Retrieve statistics for name (transport) `service`
```go
stats, err := client.GetTSStats(ctx, "service")
if err != nil {
// handle err
}
```