# Go license client

Standard library only — no third-party dependencies.

```go
client, err := licenseclient.New(
    "https://YOUR-SERVER",
    "your-product-slug",
    "PASTE_SIGNING_PUBLIC_KEY_FROM_/docs_HERE",
)
if err != nil {
    log.Fatal(err)
}

result := client.Check(licenseKey)
if result.Valid {
    fmt.Println("licensed, status:", result.Status, "expires:", result.ExpiresAt)
} else {
    fmt.Println("not licensed:", result.Reason)
}
```

Copy the `licenseclient` package into your own module (adjust the import
path), or run `go run ./example <key>` here to try it against your server.
See the `/docs` page on your server for the full protocol reference.

`Check()` calls `/api/v1/verify` first, and transparently falls back to
`/api/v1/activate` the first time a key is used on a device. Every response
is Ed25519-verified locally before being trusted or cached. If the server is
unreachable, the last-known-good signed response is used for up to 72h
(`FromOfflineCache: true` on the result) before failing closed. `Check()`
never returns an `error` — every failure mode is a `Result{Valid: false,
Reason: "..."}` so callers only need one code path.
