aere-cloud-sdk/go/README.md
Liviu ed88a38a4e aere-cloud Go 1.5.0: the Go client (standard library only), same surface as the JS client
Import path git.aere.network/aere-network/aere-cloud-sdk/go. JSON routes return json.RawMessage; the audit export and the check of a
kept export return typed results with the sha256 computed locally. Redirects are not followed. go test ./... runs offline against a
local httptest server; control-negativ.mjs breaks six guards in a copy of the package and requires each one's test to fail.
2026-09-25 10:45:59 +03:00

44 lines
1.9 KiB
Markdown

# aere-cloud (Go)
The official Go client for the [Aere Cloud API](https://aere.network/cloud.html) on Aere Network (chain 2800).
**Zero dependencies** beyond the Go standard library. Same routes and semantics as the JS, Python and Java
clients 1.5.0.
JSON routes return the server's JSON as `json.RawMessage`, so you decode it into the types you already use. The two
routes that return files (the audit export and the check of a kept export) return typed results, with the SHA-256
computed locally from the bytes received.
## Use
```go
import aerecloud "git.aere.network/aere-network/aere-cloud-sdk/go"
c, err := aerecloud.New(os.Getenv("AERE_KEY"))
head, err := c.DataHead(ctx) // {"block":...,"chainId":2800,...}
n, err := c.BlockNumber(ctx)
// quantum-readiness scan of a domain's TLS edge: free, no key is sent unless you attest the report
report, err := c.Readiness(ctx, "example.com", false, false)
// the audit log of a day as a file; Verified is true only if the sha256 of the bytes you received equals the digest
day, err := c.AuditExport(ctx, "2026-09-24", "jsonl")
// a kept export still matches the day we hold, or the tombstone a deleted day left behind
k, err := c.AuditVerifyKept(ctx, "2026-05-01", keptBytes)
// verify a webhook delivery (constant-time HMAC-SHA256 over the exact bytes received)
ok := aerecloud.VerifyWebhook(rawBody, r.Header.Get("x-aere-signature"), secret)
```
Non-2xx answers come back as `*aerecloud.Error` with `Status`, `Body` and `Path`. The client does not follow
redirects: a 3xx is returned as an answer, so your API key is never sent to a host you did not name.
## Tests
```
go test ./... # offline, against a local httptest server
node control-negativ.mjs # breaks six guards in a copy of the package; each one's test must fail
```
Measured 2026-09-25: 7 tests green; the negative control 6 of 6 red, the untouched package green.