Operate in this repository as the maintainer of the gosoline application framework—a Go-based toolkit for building cloud microservices with first-class AWS integration.
- Module path:
github.com/justtrackio/gosoline - Go toolchain: 1.24 (see
.tool-versionsfor exact patch level) - Primary frameworks: Gin (HTTP), AWS SDK v2, testify, mockery
- Key tags: most packages ship
fixturesandintegrationbuild tags. Always include both when building, testing, or linting to pull in fixture wiring.
pkg/: Core framework packages (50+ packages covering application lifecycle, configuration, logging, AWS integrations, streaming, HTTP server, database, caching, etc.)examples/: Sample applications demonstrating gosoline features and best practices.test/: Integration and E2E test suites (blob, cloud, conc, db, db-repo, dbx, ddb, fixtures, guard, httpserver, mdlsub, stream, suite). Requires Docker..github/workflows/: CI pipelines—mockery check, build, golangci-lint, unit tests, race tests, integration tests.
- Capture user requirements and convert them into a todo list (use the
todowritetool). Keep a single active item at a time. - Survey the relevant package (readme, docs, nested AGENTS.md) before editing code.
- Edit Go sources and immediately format using
gofumpt -w <files>. - Regenerate artifacts after interface changes:
- Mocks:
go generate -run='mockery' ./...
- Mocks:
- Validate locally:
gofumpt -w .go build -tags fixtures,integration ./...go test -tags fixtures,integration ./...golangci-lint run --build-tags integration,fixtures ./...
- Check for missing godoc parts for exported types/functions you added or changed.
- Update AGENTS.md files if your changes affect package structure, APIs, or workflows documented there. Check both the root
AGENTS.mdand any package-specificAGENTS.md(e.g.,pkg/<package>/AGENTS.md). - Summarize work with requirement coverage, commands executed, and pending follow-ups. Never stage or commit; CI and reviewers expect clean diffs only.
- Repository:
justtrackio/gosoline. - Auth & status:
gh auth statusto confirm login. - Search issues/PRs:
gh search issues "<query>" --repo justtrackio/gosolineandgh search prs "<query>" --repo justtrackio/gosoline. - Inspect an issue:
gh issue view <number> --repo justtrackio/gosoline. - Inspect a PR:
gh pr view <number> --repo justtrackio/gosoline --webor--jsonfor structured output. - CI status:
gh pr checks <number> --repo justtrackio/gosoline. - Pull requests: Only create PRs when asked to; prefer
gh pr createwith a summary and checklist.
- Branch creation: Only create branches when asked to. Else let maintainers handle branch creation.
- Commits: Only commit on feature branches, never main or master.
- Pull requests: Only create PRs when asked to.
- Merging: Never merge PRs yourself. Leave merges to maintainers or automated pipelines.
| Task | Command |
|---|---|
| Format | gofumpt -w . |
| Build | go build -tags fixtures,integration ./... |
| Unit tests | go test ./... |
| Unit tests (race) | go test -race ./... |
| Integration tests | go test -tags integration,fixtures ./test/... |
| Lint | golangci-lint run --build-tags integration,fixtures ./... |
| Mock generation | go generate -run='mockery' ./... |
| Targeted test | go test -tags fixtures,integration ./test/<package>/... -run <TestName> |
| Package | Purpose |
|---|---|
application/ |
Application entry point, lifecycle management |
kernel/ |
Module orchestration, startup/shutdown sequencing |
cfg/ |
Configuration management, AppId, macro interpolation |
log/ |
Structured logging infrastructure |
httpserver/ |
Gin-based HTTP server, middleware, handlers |
stream/ |
Message streaming, consumers, producers |
mdl/ |
Model definitions, ModelId |
mdlsub/ |
Model subscription patterns |
| Package | AWS Service |
|---|---|
athena/ |
Athena |
cloudwatch/ |
CloudWatch metrics/logs |
dynamodb/ |
DynamoDB |
ec2/ |
EC2 instance metadata |
ecs/ |
ECS container metadata |
glue/ |
Glue Data Catalog |
kinesis/ |
Kinesis Data Streams |
rds/ |
RDS |
resourcegroupstaggingapi/ |
Resource Groups Tagging API |
s3/ |
S3 object storage |
sagemakerruntime/ |
SageMaker Runtime |
secretsmanager/ |
Secrets Manager |
servicediscovery/ |
Cloud Map service discovery |
ses/ |
Simple Email Service |
sns/ |
Simple Notification Service |
sqs/ |
Simple Queue Service |
ssm/ |
Systems Manager Parameter Store |
| Package | Purpose |
|---|---|
db/ |
Database connections, migrations |
db-repo/ |
Repository pattern for SQL |
ddb/ |
DynamoDB repositories, naming |
redis/ |
Redis client, caching |
kvstore/ |
Key-value store abstraction |
blob/ |
Blob storage abstraction |
fixtures/ |
Test fixture loading |
| Package | Purpose |
|---|---|
http/ |
HTTP client utilities |
grpcserver/ |
gRPC server support |
kafka/ |
Kafka integration (topics, consumer groups) |
| Package | Purpose |
|---|---|
metric/ |
Metrics collection and export |
tracing/ |
Distributed tracing (X-Ray, OpenTelemetry) |
| Package | Purpose |
|---|---|
guard/ |
Authorization and access control |
oauth2/ |
OAuth2 integration |
| Package | Purpose |
|---|---|
appctx/ |
Cross-module shared state container |
cache/ |
Caching abstraction |
conc/ |
Concurrency utilities |
exec/ |
Retry, backoff, execution helpers |
clock/ |
Time abstraction for testing |
uuid/ |
UUID generation |
funk/ |
Functional utilities (map, filter, etc.) |
mapx/ |
Map utilities |
cast/ |
Type casting helpers |
coffin/ |
Goroutine lifecycle management |
currency/ |
Currency handling |
dbx/ |
Database extensions (sqlx-based query helpers) |
encoding/ |
Encoding utilities |
validation/ |
Input validation |
Gosoline uses a macro system for consistent resource naming across AWS services and data stores.
Used in queue/topic/stream/namespace names via cfg.Identity.Format():
{app.env}- environment fromapp.envconfig{app.name}- application name fromapp.nameconfig{app.tags.<key>}- any tag value (fully dynamic)
Tags are fully dynamic - common examples include project, family, group, but any tag key is supported (e.g., {app.tags.region}, {app.tags.team}, {app.tags.costCenter}).
Each service adds its own resource identifiers:
- SQS:
{queueId} - SNS:
{topicId} - Kinesis:
{streamName} - Kafka:
{topicId},{groupId} - Redis:
{name}(redis client name) - SageMaker Runtime:
{name}
Used in DynamoDB table names via cfg.Identity.Format() with mdl.ModelId.ToMap():
{app.env}- fromModelId.Env{app.name}- fromModelId.Application{app.tags.<key>}- fromModelId.Tags{name}- the model's name
Canonical Model IDs (app.model_id.domain_pattern):
For canonical model IDs (used in message routing, etc.), the pattern works differently:
- It supports standard
{app.env},{app.name}, and{app.tags.*}placeholders {modelId}is NOT used; the model name is automatically appended as the last segment (dot-separated)- Patterns may freely mix placeholders with static text and use any delimiter between placeholders
- Example patterns:
{app.tags.project}.{app.env}->myProject.production.myModelprefix-{app.env}->prefix-production.myModel{app.tags.project}-{app.env}->myProject-production.myModel
Note: DynamoDB table naming uses ModelId.ToMap() with Identity.Format() (same Identity macro system).
# SQS queue naming
cloud.aws.sqs.clients.default.naming.queue_pattern: "{app.namespace}-{queueId}"
# SNS topic naming
cloud.aws.sns.clients.default.naming.topic_pattern: "{app.namespace}-{topicId}"
# Kinesis stream naming
cloud.aws.kinesis.clients.default.naming.stream_pattern: "{app.namespace}-{streamName}"
# DynamoDB table naming
cloud.aws.dynamodb.clients.default.naming.table_pattern: "{app.namespace}-{name}"
# Kafka topic naming
kafka.naming.topic_pattern: "{app.namespace}-{topicId}"
# CloudWatch namespace
metric.writer.cloudwatch.naming.pattern: "{app.tags.project}/{app.env}/{app.tags.family}/{app.tags.group}-{app.name}"Unknown placeholders in naming patterns return an error. Allowed placeholders are:
- Fixed identity:
{app.env},{app.name} - Dynamic tags: any
{app.tags.<key>}where<key>is non-empty - Resource-specific: as registered by each service (e.g.,
{queueId},{topicId})
This prevents typos like {app.tag.project} (missing 's') or old-style {project} from silently failing.
Tags are only required if the naming pattern uses them. For example:
- Pattern
{app.env}-{queueId}does NOT require any tags - Pattern
{app.tags.project}-{app.env}-{queueId}requires only theprojecttag - Pattern
{app.tags.region}-{app.tags.team}-{app.env}requiresregionandteamtags
- File naming:
snake_case.go - Exported names:
CamelCase - JSON struct tags:
camelCase - Config struct tags:
cfg:"key_name" - Wrap errors:
fmt.Errorf("<context>: %w", err) - Always propagate
context.Context - Prefer dependency injection via gosoline configuration modules
- Tests use
github.com/stretchr/testify, Matchcontext.Contextarguments withmatcher.Contextfrompkg/test/matcher - Keep build tags aligned across source and tests (
//go:build fixtures/integration)