Skip to content

Repository files navigation

🖖🚀 Narada

Rapid web development, all in one place

Go Report CardGoDocBuild StatusCoverage Status

What is under the hood?

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

Modules

Config

Dependency:*viper.Viper
Configuration:
Configuration file are located at NARADA_CONFIG or config.yml.
Environment BINDING_API will be replaced to binding.api.

Logger

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]

Workers

This module generates

Dependency:*narada.Workers

Clients

Here all clients that are provided automatically located.

Redis

Dependency:*redis.ClientConfiguration:

redis:
addr: ""# Redis address, in e.g.: 127.0.0.1:6379db: 0password: ""pool_size: 10idle_timeout: 60s

PostgreSQL

Dependency:*bun.DB
Configuration:

database:
addr: ""# PostgreSQL addressuser: ""password: ""database: ""pool: 10ssl: true # verifies the server certificate against the system roots

Upgrading from v1

v2 is a breaking release; the module path is now github.com/cryptopay-dev/narada/v2.

  • *logrus.Logger -> *slog.Logger. Injected constructors take *slog.Logger. Replace log.WithError(err).Error("msg") with log.Error("msg", narada.Err(err)), log.WithField(k, v) with log.With(k, v), and log.Fatal(...) with narada.Fatal(log, ...) (slog has no fatal level — the record is emitted at error level and the process exits). The logrus hooks are now slog.Handler decorators: NewLogrusSentryHook/NewLogrusSlackHook became NewSentryHandler/NewSlackHandler.
  • *pg.DB -> *bun.DB. Query building moves to bun. Migrations still run on goose and the goose_db_version ledger is untouched.
  • database.ssl: true now verifies the server certificate on the migrations connection too; it previously used sslmode=verify-ca there (chain verified, hostname not) while the application connection already required a hostname match.

About

Golang application framework

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages