Skip to content

mizcausevic-dev/aeo-sdk-go

Repository files navigation

aeo-sdk-go

Go Reference Go Report Card License: MIT

Go SDK for the AEO Protocol v0.1 — parse, build, validate, and fetch AEO declaration documents. Zero non-stdlib dependencies.

Install

go get github.com/mizcausevic-dev/aeo-sdk-go

Quickstart

package main

import (
    "context"
    "fmt"
    "log"

    aeo "github.com/mizcausevic-dev/aeo-sdk-go"
)

func main() {
    // Fetch and parse from a live well-known URL
    doc, err := aeo.FetchWellKnown("https://mizcausevic-dev.github.io")
    if err != nil {
        log.Fatal(err)
    }
    fmt.Println(doc.Entity.Name)                              // "Miz Causevic"
    fmt.Println(doc.ClaimIDs())                               // [current-role location ...]
    fmt.Println(doc.FindClaim("years-experience").Value)      // 30

    // Parse from bytes
    doc2, _ := aeo.ParseDocumentString(`{"aeo_version":"0.1", ...}`)

    // Custom HTTP client with context
    ctx := context.Background()
    client := aeo.DefaultClient()
    _, _ = client.FetchWellKnown(ctx, "https://example.com")

    _ = doc2
}

What it does

  • ParseParseDocument(bytes), ParseDocumentString(s), LoadDocument(path) — all use json.DisallowUnknownFields for strict conformance
  • BuildDocument, Entity, Authority, Claim, Verification, CitationPreferences, AnswerConstraints, Audit are all exported struct types with proper JSON tags
  • Serializedoc.Marshal() returns pretty-printed JSON
  • Fetchaeo.FetchWellKnown(origin) does HTTP discovery against /.well-known/aeo.json with Accept: application/aeo+json, application/json. Custom Client lets you bring your own *http.Client and pass a context.Context.
  • Querydoc.ClaimIDs() and doc.FindClaim(id) helpers

Conformance

Supports the AEO Protocol at conformance Level 1 (Declare). Signature verification (L2) and audit-endpoint posting (L3) deferred to v0.2.

Dependencies

None. Uses only the standard library: encoding/json, net/http, context, io.

Development

go vet ./...
go test -race -v ./...
go build ./...

Specification

Full spec at github.com/mizcausevic-dev/aeo-protocol-spec.

License

MIT-licensed. Free for commercial and non-commercial use with attribution. The AEO Protocol specification this SDK implements is also MIT (see aeo-protocol-spec).

Kinetic Gain Protocol Suite

Spec Implementation
AEO Protocol aeo-sdk-python · aeo-sdk-typescript · aeo-sdk-rust · aeo-sdk-go (this) · aeo-cli · aeo-crawler
Prompt Provenance
Agent Cards
AI Evidence Format
MCP Tool Cards

Connect: LinkedIn · Kinetic Gain · Medium · Skills

About

Go SDK for the AEO Protocol v0.1. Parse, build, validate, and fetch AEO declaration documents. Zero non-stdlib dependencies. Strict json.DisallowUnknownFields parsing. Context-aware HTTP client.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages