Serp-go
Go client library for SerpTech facial recognition platform
Installation
go get github.com/serptech/serp-go
Configuration
Set your SerpTech API tokens and base URL as environment variables in .env file:
SERP_ACCESS_TOKEN=
SERP_ROOT_TOKEN=
SERP_BASE_URL=https://cloud.serptech.ru/api/
SERP_DEBUG=True
Usage
Base usage
package main
import (
"encoding/json"
"fmt"
"log"
"github.com/serptech/serp-go/api/client"
)
func main() {
cl, err := client.NewClient()
if err != nil {
log.Fatalf("create client: %v", err)
}
health, err := cl.Utility().Health()
if err != nil {
log.Fatalf("health check: %v", err)
}
encoded, err := json.MarshalIndent(health, "", " ")
if err != nil {
log.Fatalf("encode health: %v", err)
}
fmt.Println(string(encoded))
}