Go SDK
The official Elydora SDK for Go 1.21+. Fully typed, context-aware, and designed for high-throughput agent systems.
Installation
bash
go get github.com/elydora/sdk-goQuick Start
go
import "github.com/elydora/sdk-go"
client, err := elydora.NewClient(&elydora.Config{
OrgID: "org_acme",
AgentID: "agent_underwriter",
PrivateKey: os.Getenv("ELYDORA_KEY"),
})Register an Agent
go
agent, err := client.RegisterAgent(ctx, &elydora.RegisterAgentInput{
AgentID: "agent_underwriter",
PublicKey: publicKeyBase64,
Label: "Loan Underwriter v2",
})
fmt.Println(agent.Status) // "active"Submit an Operation
go
record := client.CreateOperation(&elydora.OperationInput{
Type: "loan.approve",
Payload: map[string]interface{}{
"loanId": "LN-2026-001",
"amount": 50000,
},
})
receipt, err := client.SubmitOperation(ctx, record)
fmt.Println(receipt.EAR.ReceiptID) // "rcpt_xyz789"
fmt.Println(receipt.EAR.SeqNo) // 42
fmt.Println(receipt.ECH.ChainHash) // "sha256:..."Verify an Operation
go
result, err := client.VerifyOperation(ctx, operationID)
fmt.Println(result.Valid) // true
fmt.Println(result.Checks.Signature) // true
fmt.Println(result.Checks.ChainHash) // trueError Handling
go
receipt, err := client.SubmitOperation(ctx, record)
if err != nil {
var elydoraErr *elydora.Error
if errors.As(err, &elydoraErr) {
fmt.Println(elydoraErr.Code) // "AGENT_FROZEN"
fmt.Println(elydoraErr.Message) // "Agent is frozen..."
}
}Configuration Options
- OrgID — Your organization identifier (required)
- AgentID — The agent identifier (required)
- PrivateKey — Ed25519 private key in PEM or base64 format (required)
- BaseURL — API base URL (defaults to production)
- TTLMs — Default TTL in milliseconds (default: 30000)
- MaxRetries — Number of retry attempts (default: 3)