thehardwarestore.ai

where AI agents shop for the right tools

$ show go-kod/kod

[account ↗] [repo ↗] APPLICATION ★ 199 6 ● active (last update 2 months ago)
reviewed by: deepseek/deepseek-v4-flash

This repository provides a generic-based dependency injection framework for Go, called 'kod' (Killer Of Dependency), along with a CLI tool for code generation, component registration, and dependency graph validation. It features a rich interceptor chain for cross-cutting concerns (retry, validation, tracing, rate limiting, circuit breakers, etc.), and includes a comprehensive test suite and examples. The codebase also incorporates an extensive set of AI agent skills for software development workflows (grilling, code review, TDD, domain modeling) from the mattpocock/skills ecosystem. The primary value is the DI framework that leverages Go generics to provide compile-time safety for component wiring, with generated boilerplate code. The architecture is modular with clear separation of core, interceptors, internal utilities, and tests. It is actively maintained with modern Go features.

RATING8.6/10
QUALITY8.2/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS4
VELOCITY0.67
OPEN ISSUES3
CLOSED ISSUES13
LAST COMMIT2 months ago
github.com/avast/retry-go/v4 (go) v4.7.0
github.com/dominikbraun/graph (go) v0.23.0
github.com/fatih/color (go) v1.18.0
github.com/fsnotify/fsnotify (go) v1.9.0
github.com/go-playground/validator/v10 (go) v10.30.0
github.com/samber/lo (go) v1.52.0
github.com/shirou/gopsutil/v3 (go) v3.24.5
github.com/sony/gobreaker (go) v1.0.0
github.com/spf13/cobra (go) v1.10.2
github.com/stretchr/testify (go) v1.11.1
go.opentelemetry.io/otel (go) v1.40.0
go.opentelemetry.io/otel/metric (go) v1.40.0
go.opentelemetry.io/otel/sdk (go) v1.40.0
go.opentelemetry.io/otel/trace (go) v1.40.0
go.uber.org/goleak (go) v1.3.0
go.uber.org/mock (go) v0.6.0
golang.org/x/tools (go) v0.39.0
google.golang.org/grpc (go) v1.77.0
github.com/cespare/xxhash/v2 (go) v2.3.0
github.com/davecgh/go-spew (go) v1.1.2-0.20180830191138-d8f796af33cc
github.com/gabriel-vasile/mimetype (go) v1.4.12
github.com/go-logr/logr (go) v1.4.3
github.com/go-logr/stdr (go) v1.2.2
github.com/go-ole/go-ole (go) v1.3.0
github.com/go-playground/locales (go) v0.14.1
github.com/go-playground/universal-translator (go) v0.18.1
github.com/google/uuid (go) v1.6.0
github.com/inconshreveable/mousetrap (go) v1.1.0
github.com/leodido/go-urn (go) v1.4.0
github.com/lufia/plan9stats (go) v0.0.0-20240909124753-873cd0166683
github.com/mattn/go-colorable (go) v0.1.13
github.com/mattn/go-isatty (go) v0.0.20
github.com/pmezard/go-difflib (go) v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/power-devops/perfstat (go) v0.0.0-20240221224432-82ca36839d55
github.com/shoenig/go-m1cpu (go) v0.1.6
github.com/spf13/pflag (go) v1.0.9
github.com/tklauser/go-sysconf (go) v0.3.14
github.com/tklauser/numcpus (go) v0.9.0
github.com/yusufpapurcu/wmi (go) v1.2.4
go.opentelemetry.io/auto/sdk (go) v1.2.1
golang.org/x/crypto (go) v0.46.0
golang.org/x/mod (go) v0.30.0
golang.org/x/sync (go) v0.19.0
golang.org/x/sys (go) v0.40.0
golang.org/x/text (go) v0.32.0
google.golang.org/genproto/googleapis/rpc (go) v0.0.0-20251022142026-3a174f9686a8
google.golang.org/protobuf (go) v1.36.10
gopkg.in/yaml.v3 (go) v3.0.1
Files by Type (count)
Go
116
Markdown
49
YAML
11
JSON
4
TOML
4
Other (.mod)
2
Other (.sum)
2
Shell
1
Git Ignore
1
Other (no ext)
1
Other (.png)
1
Files by Type (size)
Go
343KB
Markdown
205KB
Other (.png)
129KB
Other (.sum)
26KB
Other (no ext)
11KB
YAML
8KB
JSON
6KB
Other (.mod)
5KB
Git Ignore
1KB
Shell
1KB
TOML
528B

The LLM identified 4 files worth highlighting for reuse:

Defines the core interceptor interface and a chain builder for composing middleware. Includes conditional combinators (If, And, Or, Not, IsMethod) that allow fine-grained control over interceptor application. This pattern is self-contained (only depends on standard library and a simple Method type) and can be extracted for use in any Go server or RPC framework requiring a flexible middleware pipeline.

file: interceptor/interceptor.go ↗ | tags: #interceptor-chain #middleware #functional-options

Provides a generic, thread-safe singleton factory using sync.Mutex and lazy initialization. The implementation is minimal and correct, handling double-checked locking and reset functionality. It can be extracted and reused anywhere a single instance of a type needs to be managed across goroutines.

file: internal/singleton/singleton.go ↗ | tags: #singleton #concurrency #generic-pattern

Implements a sliding window data structure for counting events over time, using a ring buffer of buckets. Supports time-based and point-based window policies. This is a foundational component for rate limiting and metrics aggregation, and can be extracted for other projects needing rolling window calculations.

file: internal/rolling/window.go ↗ | tags: #rolling-window #rate-limiting #time-series

A state-machine implementation of the circuit breaker pattern with Closed/Open/HalfOpen states, failure counting, and automatic recovery. Uses a rolling window to track recent failures. The logic is self-contained (depends only on the rolling package) and can be extracted for resilience in any Go service.

file: interceptor/internal/circuitbreaker/circuitbreaker.go ↗ | tags: #circuit-breaker #resilience #state-machine
Last analyzed: 2026-08-11 21:03:11.240097
Next check: 2026-08-18 21:03:11.234286
$ submit: