config

package
v0.0.0-...-fc94236 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PostgresDatabaseName = "postgres"
	PostgresDatabaseUser = "postgres"
	DatabasePort         = 5432
	DatabaseDriver       = "postgres"
)

Variables

This section is empty.

Functions

func SetupLogging

func SetupLogging(conf *Config) *slog.Logger

Types

type Config

type Config struct {
	// The name of the application
	ApplicationName string `env:"APP_NAME, required"`
	// The namespace to work in
	Namespace string `env:"NAMESPACE, required"`
	// New instance configuration
	TargetInstance InstanceSettings `env:", prefix=TARGET_INSTANCE_"`

	// Logging configuration
	Logging

	// Development mode config
	Development Development `env:", prefix=DEVELOPMENT_MODE_"`
}

type Development

type Development struct {
	// Skips taking backups
	SkipBackup bool `env:"SKIP_BACKUP"`

	// Sets an unsafe, pre-defined password for postgres user
	UnsafePassword bool `env:"UNSAFE_PASSWORD"`
}

type FinalizeConfig

type FinalizeConfig struct {
	Config

	// Source instance name
	SourceInstanceName string `env:"SOURCE_INSTANCE_NAME, required"`
}

type InstanceSettings

type InstanceSettings struct {
	Name           string `env:"NAME, required"`
	Type           string `env:"TYPE"`
	Tier           string `env:"TIER"`
	DiskSize       int    `env:"DISK_SIZE"`
	DiskAutoresize *bool  `env:"DISK_AUTORESIZE, noinit"`
}

type Logging

type Logging struct {
	Level  slog.Level `env:"LOG_LEVEL, default=INFO"`
	Format string     `env:"LOG_FORMAT, default=TEXT"`
}

type RollbackConfig

type RollbackConfig struct {
	Config

	// Source instance configuration
	SourceInstance InstanceSettings `env:", prefix=SOURCE_INSTANCE_"`
}

Jump to

Keyboard shortcuts

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