Skip to content
/ iken Public

Helper go packages for Http, zerolog, and pgx.

License

Notifications You must be signed in to change notification settings

bir/iken

Repository files navigation

iken GitHub Workflow Status codecov PkgGoDev Report card FOSSA Status

forthebadge forthebadge forthebadge

iken is an opinionated library for building apps in go.

High Level Opinions

  1. Errors should be managed
  2. Panics should be managed
  3. Developer Experience is critical to adoption
  4. Obfuscate nothing - code should be clear to read and trace.
  5. Testability is important
  6. Dependency injection is critical to testability
  7. Global vars are evil
  8. Favor easy codegen over obfuscating libraries when feasible

Concrete Opinions

  1. net/http is the preferred handler
  2. Postgres is the preferred SQL DB
  3. pgx is the preferred Postgres library
  4. 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

FOSSA Status