Example
go get git.datacoria.com/Phylex/as213905-sdk/go@v1.1.0Example
package main
import (
"context"
"fmt"
"log"
"os"
as213905 "git.datacoria.com/Phylex/as213905-sdk/go/as213905"
)
func main() {
client := as213905.New(os.Getenv("AS213905_API_KEY"))
traffic, err := client.Traffic(context.Background(), &as213905.TrafficQuery{Days: 7})
if err != nil { log.Fatal(err) }
fmt.Printf("p95: %d kbps\n", traffic.P95Kbps)
}Credential handling
Read the API key from a secret or environment variable. Reuse one client instance, set request cancellation in your application, and handle 429 responses according to Retry-After.