authzed-go icon indicating copy to clipboard operation
authzed-go copied to clipboard

Add API usage examples and documentation references

Open ivanauth opened this issue 3 months ago • 0 comments

Summary

Add comprehensive examples demonstrating common authzed-go operations and link to external documentation resources in the README.

Fixes #142

Changes

  • Add examples/example_test.go with 12 runnable examples covering:
    • Connecting to Authzed and SpiceDB
    • Writing schemas and relationships
    • Checking permissions (single and bulk)
    • Looking up resources and subjects
    • Reading and deleting relationships
    • Using caveats (conditional permissions)
    • Watching for changes
  • Update README with examples table and external documentation links

Testing

# Build examples
go build ./examples/...

# Run examples (requires local SpiceDB)
docker run --rm -p 50051:50051 authzed/spicedb serve --grpc-preshared-key "somerandomkeyhere"
go test -v ./examples/...

ivanauth avatar Nov 25 '25 19:11 ivanauth