iken
iken is an opinionated library for building apps in go.
High Level Opinions
- Errors should be managed
- Panics should be managed
- Developer Experience is critical to adoption
- Obfuscate nothing - code should be clear to read and trace.
- Testability is important
- Dependency injection is critical to testability
- Global vars are evil
- Favor easy codegen over obfuscating libraries when feasible
Concrete Opinions
- net/http is the preferred handler
- Postgres is the preferred SQL DB
- pgx is the preferred Postgres library
- zerolog is the preferred Logger
Preferred is the keyword, as the packages in iken ease the support for these libraries, but do not prevent any
other options.
Motivation
We had several
Current projects
errs
Support for cause chaining with a nil check. The excellent pkg.errors does not handle the case where Cause()
returns
nil.
WithStack
provides an easy stack traced error with options to ignore depth. Useful for tracking panics caught in
middleware. It also provides some utilities for marshalling to logging for easy of logging.
httputil
Collection of minor tools for use with HTTP.
ErrorHandler
Standardized handling of errors in an HTTP request flow.
pgxzero
validation
License