Rapid web development, all in one place
Under the hood a lot of different and cool packages such as:
- log/slog (stdlib)
- Bun
- Go-redis
- Uber FX
- Viper
- Sentry
- Pprof
- Prometheus
Also it supports:
- Workers using chapsuk workers package
- Http.Handler binding and serving
Dependency:*viper.Viper
Configuration:
Configuration file are located at NARADA_CONFIG or config.yml.
Environment BINDING_API will be replaced to binding.api.
Dependency:*slog.Logger
Configuration:
logger: formatter: text # Supported values ['text', 'json']level: debug # Supported values ['debug', 'info', 'warn', 'error']catch_errors: true # Sending >=error level to sentryslack: false # Sending >= error level to slack slack_url: ""# Slack webhook url [Required when slack is true]slack_icon: ""slack_emoji: ":ghost:"slack_username: "<YOUR_APP_NAME>_bot"slack_channel: ""# Slack username [Required when slack is true]This module generates
Dependency:*narada.Workers
Here all clients that are provided automatically located.
Dependency:*redis.ClientConfiguration:
redis:
addr: ""# Redis address, in e.g.: 127.0.0.1:6379db: 0password: ""pool_size: 10idle_timeout: 60sDependency:*bun.DB
Configuration:
database:
addr: ""# PostgreSQL addressuser: ""password: ""database: ""pool: 10ssl: true # verifies the server certificate against the system rootsv2 is a breaking release; the module path is now
github.com/cryptopay-dev/narada/v2.
*logrus.Logger->*slog.Logger. Injected constructors take*slog.Logger. Replacelog.WithError(err).Error("msg")withlog.Error("msg", narada.Err(err)),log.WithField(k, v)withlog.With(k, v), andlog.Fatal(...)withnarada.Fatal(log, ...)(slog has no fatal level — the record is emitted at error level and the process exits). The logrus hooks are nowslog.Handlerdecorators:NewLogrusSentryHook/NewLogrusSlackHookbecameNewSentryHandler/NewSlackHandler.*pg.DB->*bun.DB. Query building moves to bun. Migrations still run ongooseand thegoose_db_versionledger is untouched.database.ssl: truenow verifies the server certificate on the migrations connection too; it previously usedsslmode=verify-cathere (chain verified, hostname not) while the application connection already required a hostname match.