config

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package config holds the persistence configuration types in a leaf package so the connector and migrator can import them without cycles.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Driver   string
	Postgres PostgresConfig
	Test     bool
}

Config selects the persistence driver and carries its settings. Test enables the smaller test connection pool and skips re-pinging a pool that is already in use (suite-level transactions hold a connection open).

type PostgresConfig

type PostgresConfig struct {
	Host          string `mapstructure:"host"           validate:"required"`
	Port          int    `mapstructure:"port"           validate:"required"`
	Name          string `mapstructure:"name"           validate:"required"`
	Username      string `mapstructure:"username"       validate:"required"`
	Password      string `mapstructure:"password"       validate:"required"`
	Timeout       int    `mapstructure:"timeout"        validate:"required"`
	SSLMode       string `mapstructure:"ssl_mode"       validate:"required,oneof=disable require verify-ca verify-full"`
	MigrationPath string `mapstructure:"migration_path"`
}

PostgresConfig holds PostgreSQL connection settings. Services embed it in their config structs; the mapstructure/validate tags live here so every service shares the same config schema.

Jump to

Keyboard shortcuts

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