Model
Architecture diagrams as code using the C4 model - version-controlled, automatically generated, and interactive.
The Goa ecosystem includes companion libraries that address common needs in microservice development. These tools are designed to work seamlessly with Goa but can also be used independently.
| Library | Purpose | Key Features |
|---|---|---|
| Model | Architecture Diagrams | C4 diagrams as code, version control, interactive editor |
| Pulse | Distributed Events | Event streaming, worker pools, replicated maps |
| Clue | Observability | Tracing, logging, metrics, health checks |
Model provides a Go DSL for describing software architecture using the C4 model. Instead of drawing diagrams in graphical tools, you define your architecture in code:
var _ = Design("My System", "System description", func() {
var System = SoftwareSystem("My System", "Does something useful")
Person("User", "A user of the system", func() {
Uses(System, "Uses")
})
Views(func() {
SystemContextView(System, "Context", "System context diagram", func() {
AddAll()
AutoLayout(RankLeftRight)
})
})
})
Benefits:
Learn more: Model Documentation
Pulse provides primitives for building event-driven distributed systems. It’s transport-agnostic and works with or without Goa services:
// Publish events to a stream
stream.Add(ctx, "user.created", userEvent)
// Subscribe to events
reader.Subscribe(ctx, func(event *Event) error {
return processEvent(event)
})
Use cases:
Learn more: Pulse Documentation
Clue provides instrumentation for Goa services built on OpenTelemetry. It covers the three pillars of observability:
// Configure OpenTelemetry
cfg := clue.NewConfig(ctx, "myservice", "1.0.0", metricExporter, spanExporter)
clue.ConfigureOpenTelemetry(ctx, cfg)
// Context-based logging
log.Info(ctx, "processing request", log.KV{"user_id", userID})
// Health checks
checker := health.NewChecker(health.NewPinger("db", dbAddr))
Features:
Learn more: Clue Documentation
| Guide | Description | ~Tokens |
|---|---|---|
| Model | C4 diagrams, DSL reference, mdl CLI | ~2,500 |
| Pulse | Streaming, worker pools, replicated maps | ~2,200 |
| Clue | Logging, tracing, metrics, health checks | ~2,800 |
Total Section: ~7,500 tokens
Choose the library that matches your needs:
All libraries are available via go get:
go get goa.design/model
go get goa.design/pulse
go get goa.design/clue