https://github.com/zoobz-io/sum
An application framework for Go
https://github.com/zoobz-io/sum
application-framework framework go golang zoobzio
Last synced: 1 day ago
JSON representation
An application framework for Go
- Host: GitHub
- URL: https://github.com/zoobz-io/sum
- Owner: zoobz-io
- License: mit
- Created: 2026-01-04T02:41:43.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-03-27T21:29:39.000Z (7 days ago)
- Last Synced: 2026-03-28T03:56:30.214Z (6 days ago)
- Topics: application-framework, framework, go, golang, zoobzio
- Language: Go
- Homepage: https://sum.zoobz.io
- Size: 150 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
README
# sum
[](https://github.com/zoobz-io/sum/actions/workflows/ci.yml)
[](https://codecov.io/gh/zoobz-io/sum)
[](https://goreportcard.com/report/github.com/zoobz-io/sum)
[](https://github.com/zoobz-io/sum/security/code-scanning)
[](https://pkg.go.dev/github.com/zoobz-io/sum)
[](LICENSE)
[](go.mod)
[](https://github.com/zoobz-io/sum/releases)
**Wire once, run anywhere.** An application framework that unifies HTTP, data, configuration, and services into a single lifecycle.
## Compose and Run
```go
// Register services by contract type
k := sum.Start()
sum.Register[UserService](k, &userImpl{})
sum.Register[OrderService](k, &orderImpl{})
sum.Freeze(k)
// Retrieve anywhere by type
userSvc := sum.MustUse[UserService](ctx)
```
Services, configuration, and data stores—all wired through one registry, resolved by type.
## Install
```bash
go get github.com/zoobz-io/sum
```
Requires Go 1.24 or later.
## Quick Start
```go
package main
import (
"context"
"log"
"github.com/zoobz-io/sum"
)
type Greeter interface {
Greet(name string) string
}
type greeterImpl struct{}
func (g *greeterImpl) Greet(name string) string {
return "Hello, " + name
}
func main() {
// Initialize service and registry
svc := sum.New(sum.ServiceConfig{Host: "localhost", Port: 8080})
k := sum.Start()
// Register services
sum.Register[Greeter](k, &greeterImpl{})
sum.Freeze(k)
// Use services anywhere
greeter := sum.MustUse[Greeter](context.Background())
log.Println(greeter.Greet("World"))
// Run with graceful shutdown
if err := svc.Run(); err != nil {
log.Fatal(err)
}
}
```
## Capabilities
| Capability | Description | Documentation |
|------------|-------------|---------------|
| Service Registry | Type-safe service locator with guards | [Registry](https://pkg.go.dev/github.com/zoobz-io/sum#Register) |
| Lifecycle Management | Singleton service with graceful shutdown | [Service](https://pkg.go.dev/github.com/zoobz-io/sum#Service) |
| Configuration | Load and register config via fig | [Config](https://pkg.go.dev/github.com/zoobz-io/sum#Config) |
| Typed Events | Emit and listen with type-safe payloads | [Event](https://pkg.go.dev/github.com/zoobz-io/sum#Event) |
| Data Stores | Database, KV, and object storage helpers | [Database](https://pkg.go.dev/github.com/zoobz-io/sum#Database) |
## Why sum?
- **Type-safe service registry** — Register and retrieve services by contract type, not strings. Compile-time safety, zero casting.
- **Unified lifecycle** — One `Run()` handles startup, signal handling, and graceful shutdown.
- **Integrated data catalog** — Databases, KV stores, and buckets register automatically with the data catalog for observability.
- **Typed events** — Define events once with `Event[T]`, emit and listen with full type safety.
- **Minimal ceremony** — No annotations, no reflection magic, no code generation. Just Go.
## The Ecosystem
sum builds on the zoobz-io toolkit:
| Package | Purpose |
|---------|---------|
| [rocco](https://github.com/zoobz-io/rocco) | HTTP engine with OpenAPI |
| [slush](https://github.com/zoobz-io/slush) | Service registry core |
| [capitan](https://github.com/zoobz-io/capitan) | Event/signal system |
| [fig](https://github.com/zoobz-io/fig) | Configuration loading |
| [grub](https://github.com/zoobz-io/grub) | Database/KV/Object storage |
| [scio](https://github.com/zoobz-io/scio) | Data catalog |
## Documentation
- **Learn**: [Overview](docs/1.learn/1.overview.md) · [Quickstart](docs/1.learn/2.quickstart.md) · [Concepts](docs/1.learn/3.concepts.md) · [Architecture](docs/1.learn/4.architecture.md)
- **Guides**: [Testing](docs/2.guides/1.testing.md) · [Troubleshooting](docs/2.guides/2.troubleshooting.md) · [Service Registry](docs/2.guides/3.service-registry.md) · [Events](docs/2.guides/4.events.md) · [Data Stores](docs/2.guides/5.data-stores.md)
- **Reference**: [API](docs/4.reference/1.api.md) · [Types](docs/4.reference/2.types.md) · [pkg.go.dev](https://pkg.go.dev/github.com/zoobz-io/sum)
## Contributing
Contributions welcome—see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
## License
MIT License - see [LICENSE](LICENSE)