examples/README.md
This directory contains runnable examples demonstrating various go-micro features and patterns.
Each example can be run with go run . from its directory.
Basic RPC service demonstrating core concepts:
Run it:
cd hello-world
go run .
HTTP web service with service discovery:
Run it:
cd web-service
go run .
Multiple services in a single binary — the modular monolith pattern:
service.GroupRun it:
cd multi-service
go run .
Docker Compose deployment with MCP gateway, Consul registry, and Jaeger tracing:
docker-compose upSee the mcp/ directory for AI agent integration examples:
Multi-service project management app (Projects, Tasks, Team) with seed data and agent playground integration.
The two built-in agent capabilities in a small multi-agent system:
Middleware around an agent's tool execution with AgentWrapTool, the tool-side analogue of client/server wrappers:
A workflow as ordered, checkpointed steps that survives a crash and resumes where it stopped:
reserve → charge → confirm), not just one LLM turnResume, completed steps are not re-run (no duplicate side effects)Some examples require external dependencies:
docker run -p 4222:4222 nats:latestdocker run -p 8500:8500 consul:latest agent -dev -ui -client=0.0.0.0docker run -p 6379:6379 redis:latestTo add a new example:
go run .