Add SDK parity and Go CLI release readiness

This commit is contained in:
Codex
2026-06-07 22:35:23 +02:00
commit 61f3a217e6
11 changed files with 2797 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
package main
import (
"context"
"fmt"
"log"
"os"
attesto "git.rotz.ai/rotzmediagroup/attesto-v1/sdk/go"
)
func main() {
ctx := context.Background()
client, err := attesto.NewClient(os.Getenv("ATTESTO_API_KEY"))
if err != nil {
log.Fatal(err)
}
stream, err := client.CreateStream(ctx, attesto.StreamCreateInput{
UseCase: "ai-governance",
PolicyID: "policy-main",
})
if err != nil {
log.Fatal(err)
}
receipt, err := client.LogEvent(ctx, stream.StreamID, attesto.EventInput{
SourceRef: "example-decision",
Payload: attesto.M{
"decision": "approved",
"reason": "policy-threshold-met",
},
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s %s\n", receipt.StreamEventID, receipt.EventHash)
}