assembly

package
v0.0.0-...-fec64ea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	Mux     http.Handler
	Log     *slog.Logger
	Migrate *migrate.Migrate
	// contains filtered or unexported fields
}

func NewApp

func NewApp(conf Config) (*App, error)

func (*App) Close

func (a *App) Close(ctx context.Context) error

type Config

type Config struct {
	PostresDsn    string `envconfig:"POSTGRES_DSN"`
	HttpPort      string `envconfig:"HTTP_PORT"`
	MigrationsDir string `envconfig:"MIGRATIONS_DIR"`

	DbMaxOpenConns    int           `envconfig:"DB_MAX_OPEN_CONNS" default:"4"`
	DbMaxIdleConns    int           `envconfig:"DB_MAX_IDLE_CONNS" default:"4"`
	DbConnMaxLifetime time.Duration `envconfig:"DB_CONN_MAX_LIFETIME" default:"5m"`
	DbConnMaxIdleTime time.Duration `envconfig:"DB_CONN_MAX_IDLE_TIME" default:"5m"`

	LogLevel slog.Level `envconfig:"LOG_LEVEL" default:"INFO"`
}

func NewConfig

func NewConfig() (Config, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL