GoKit is distributed as a standard Go module and requires no code generation, no configuration files, and no build tags. Run a singleDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AndresGT/GoKit/llms.txt
Use this file to discover all available pages before exploring further.
go get command and you are ready to import whichever packages your project needs.
Prerequisites
- Go 1.25 or later — GoKit’s
go.moddeclaresgo 1.25.6. Rungo versionto confirm your toolchain. - An initialised Go module — your project must already have a
go.modfile. If it does not, create one first withgo mod init <module-path>.
Install
go.mod and go.sum. All transitive dependencies are resolved automatically.
Importable Packages
GoKit exposes four packages. Import only the ones you need — they are independent of each other.Package overview
| Package | What it provides |
|---|---|
logger | Structured leveled logger, console/file/DB writers, Gin middleware, context helpers |
middleware | Auth (JWT validation + role enforcement), CORS, Recovery, RequestID |
security/jwt | HS256 access and refresh token pairs, validation, refresh flow |
security/hash | bcrypt and Argon2id hashing with auto-detection on verify |
Key Dependencies
GoKit pulls in the following direct dependencies (versions pinned ingo.mod):
| Dependency | Used by |
|---|---|
github.com/gin-gonic/gin | Router integration in logger and middleware packages |
github.com/golang-jwt/jwt/v5 | JWT signing and parsing in security/jwt |
golang.org/x/crypto | bcrypt and Argon2id implementations in security/hash |
github.com/google/uuid | User ID type in JWT claims and log entries |
github.com/fatih/color | ANSI color output in the console writer |
gorm.io/gorm | Database writer in the logger package |
gorm.io/gorm is only required if you use logger.NewDBWriter. If you only write to the console or a file, GORM is included as a compile-time dependency but you do not need to configure a database connection.Example: Importing All Four Packages
Here is a minimal Go file that imports all four GoKit packages together. You would typically split these across separate files in a real project.go mod tidy after adding your imports to remove any unused entries from go.sum.
Verify the Installation
After runninggo get, confirm the module is present in your dependency graph: