Skip to content

About

Clone-and-own Go service framework for concurrent services: run them together locally, then deploy as one binary or split them into microservices, with retries, dependencies, graceful shutdown, and scoped logs.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Latest commit

 

History

128 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

___ ___ _____   _____ ___ ___ ___  _   ___ _  __
/ __| __| _ \ \ / /_ _/ __| __| _ \/_\ / __| |/ /
\__ \ _||   /\ V / | | (__| _||  _/ _ \ (__| ' <
|___/___|_|_\ \_/ |___\___|___|_|/_/ \_\___|_|\_\

servicepack

Go Reference CI coverage version license

Clone-and-own Go service framework: run related services together locally so you can debug the whole fucking thing in one process, then deploy it as one binary or split those services into separate microservices when that makes sense.

This is a template repo, not a go get library. It gives a new Go project a concurrent service supervisor, lifecycle runner, Docker-first build/test workflow, generated service registration, and sane places to customize it.

Quick start

Use a fresh clone. make own deliberately removes the clone's Git history, rewrites its module path, removes shipped example services (except hello-world) and servicepack's own docs, changelog and publishing files, initializes a new repository, and creates its first commit.

git clone https://github.com/psyb0t/servicepack.git my-service
cd my-service
make own MODNAME=github.com/yourname/my-service
make service NAME=worker
make build
./build/my-service run

The normal Make targets use Docker, so you do not need a matching host Go toolchain for make build, make test, or make lint. Docker must be available. See getting started before pointing it at a clone you care about.

Want to poke the shipped examples first?

git clone https://github.com/psyb0t/servicepack.git
cd servicepack
make run-dev

The examples show retries, dependency ordering, readiness, allowed failures, and a deliberate crash that stops the process after roughly 36 seconds.

Why this exists

Local composition is the useful bit: workers, API servers, migrations, and other process-level services can run together with one signal path and one structured log stream. That is not a lifetime commitment to a monolith.

  • One binary: ship the related services together when they genuinely share a release cadence and operational boundary.
  • Separate deployables: run the same image once per service with a different SERVICES_ENABLED, when a service needs independent scaling, ownership, or failure isolation. servicepack's Dependent contract only orders services in the same process; calls to a service in another deployment need their own connection and retry logic.

Everyday workflow

Command What it does
make service NAME=worker Scaffold a service and regenerate registration.
make test Run race-enabled tests in the development container.
make test-integration Run the tests including the //go:build integration ones, uncached, with Docker available to Testcontainers.
make test-coverage Enforce the default 90% coverage floor, services included.
make lint Run shell and Go linting in Docker.
make build Produce a static binary in build/, with binary name and source commit in log scope.
make docker-build Build the production image.
make help List every available target.

make servicepack-update updates the framework copy in a project made from this template. Read framework updates first; it expects a clean repository and creates a backup/update branch.

Documentation

The full documentation lives at https://psyb0t.github.io/servicepack/.

Read this For
Getting started Turning a fresh clone into your project, then adding and running a service.
Services and lifecycle Interface contracts, dependencies, retries, commands, filtering, logging, and shutdown.
Architecture The process layout, generated registration, logging, and running services in one deployment or several.
Development Docker-first Make targets, Testcontainers, coverage, builds, and overrides.
Framework updates What make servicepack-update changes, what it leaves alone, and how to keep your changes out of its way.
Reference Environment variables, interface signatures, service package rules, and every Make target.
Service manager deep dive Exact orchestration semantics and test conventions.
Runner deep dive Signals, parent contexts, and shutdown deadline behavior.
Framework Make scripts The updateable script layer and user overrides.

Project layout

cmd/                            entry point plus your init/CLI extension points
internal/app/                   application lifecycle wrapper
internal/pkg/service-manager/   concurrent service orchestration
internal/pkg/services/          your services and generated registration
pkg/runner/                     signal-aware lifecycle runner
scripts/make/servicepack/       updateable framework Make scripts
scripts/make/                   project-specific script overrides
docs/                           your operational and architectural docs
website/                        servicepack's documentation site build (make own removes it)
tests/                          your testcontainers harness and service tests

Agent integrations

Agent-facing setup and conventions live under .agents/skills/servicepack/. The skill is available through the psyb0t agents marketplace for Claude Code, Codex, and OpenClaw-compatible setups.

Sponsor

Buy Me a Coffee

License

MIT. See LICENSE. Release history lives in CHANGELOG.md.

About

Clone-and-own Go service framework for concurrent services: run them together locally, then deploy as one binary or split them into microservices, with retries, dependencies, graceful shutdown, and scoped logs.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages