gdk is an application command framework built on top of gda. It provides slash command routing, differential command synchronization, token-bucket rate limiting, UI component handling and dual execution transports (persistent Gateway WebSocket or serverless HTTP Webhooks) using only the Go standard library.
- Documentation: pkg.go.dev/github.com/sfossl/gdk
- Module:
github.com/sfossl/gda(v0.1.0) - License: MIT
Architecture & Design
gdk is organized into focused subsystems
- App: Application lifecycle runner, functional configuration, graceful shutdown, dual execution transports and modular registration (
Module). - Command: Slash command declarations, typed option definitions across all 9 Discord option types, subcommand trees, autocomplete routing and local schema validation.
- Context: Execution context passed to handlers, typed option extraction with default fallbacks, automatic 2.5-second deferral and fluent action suites.
- Component: Declarative builders for rich embeds with strict limit checking, buttons, select menus, action rows with auto-packing (
PackRows) and modals. - Middleware: Interception pipelines, 64-shard partitioned token-bucket cooldown store, permission checks and panic recovery (
Guard). - Utilities: Compound human duration parsing (
1h 30m,2d) and dynamic Discord markdown timestamp formatting (<t:UNIX:STYLE>).
Installation
Requires Go 1.24 or higher:
go get github.com/sfossl/gdk