When to Use This Template
Use the contract template when:- Multiple protocols needed - REST for web clients, JSON-RPC for internal services
- API-first design - Define contracts before implementation
- Auto-generated docs - OpenAPI specs from your code
- Clean architecture - Business logic separate from transport
What You Get
A complete service with:- Service contracts - Plain Go structs with typed methods
- REST transport - RESTful HTTP endpoints
- JSON-RPC transport - JSON-RPC 2.0 endpoint
- OpenAPI spec - Auto-generated at
/openapi.json - Discovery endpoint - List available methods
Quick Start
How Contracts Work
1. Define a Service
2. Register with Contract System
3. Mount Transports
Benefits
Write Once, Expose Multiple Ways
Your business logic is in plain Go methods:Automatic Documentation
OpenAPI spec is generated from your Go types:Type Safety
Everything is strongly typed:Discoverable
Clients can discover available methods:Project Structure
Available Transports
CLI Integration
Usemizu contract to interact with your service:
When to Use Contract vs API Template
Next Steps
Project Structure
Understand every file in detail
Tutorial
Build a contract-based service