config

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	AdminUsername     string `koanf:"admin_username"`
	AdminPassword     string `koanf:"admin_password"`
	RootURL           string `koanf:"root_url"`
	Address           string `koanf:"address"`
	UseTLS            bool   `koanf:"use_tls"`
	HTTPTLSCert       string `koanf:"http_tls_cert"`
	HTTPTLSKey        string `koanf:"http_tls_key"`
	FlowsDirectory    string `koanf:"flows_directory"`
	SecureCookieKey   string `koanf:"secure_cookie_key"`
	MaxFileUploadSize int64  `koanf:"max_file_upload_size"` // in bytes, default 100MB
}

type Config

type Config struct {
	DB         DBConfig         `koanf:"db"`
	App        AppConfig        `koanf:"app"`
	Keystore   KeystoreConfig   `koanf:"keystore"`
	OIDC       OIDCConfig       `koanf:"oidc"`
	Scheduler  SchedulerConfig  `koanf:"scheduler"`
	Logger     Logger           `koanf:"logger"`
	Metrics    Metrics          `koanf:"metrics"`
	Messengers MessengersConfig `koanf:"messengers"`
}

func GetDefaultConfig

func GetDefaultConfig() Config

GetDefaultConfig returns the default configuration values

func Load

func Load(configPath string) (Config, error)

type DBConfig

type DBConfig struct {
	DSN         string `koanf:"dsn"`
	DBName      string `koanf:"dbname"`
	User        string `koanf:"user"`
	Password    string `koanf:"password"`
	Host        string `koanf:"host"`
	Port        int    `koanf:"port"`
	SSLMode     string `koanf:"sslmode"`
	SSLCert     string `koanf:"sslcert"`
	SSLKey      string `koanf:"sslkey"`
	SSLRootCert string `koanf:"sslrootcert"`
}

func (DBConfig) ConnectionString

func (db DBConfig) ConnectionString() string

ConnectionString returns the database connection string. If DSN is set, it returns the DSN directly else it builds a URL.

type KeystoreConfig

type KeystoreConfig struct {
	KeeperURL string `koanf:"keeper_url"`
}

type Logger

type Logger struct {
	Backend       string        `koanf:"backend"`
	Directory     string        `koanf:"log_directory"`
	MaxSizeBytes  int64         `koanf:"max_size_bytes"`
	RetentionTime time.Duration `koanf:"retention_time"`
	ScanInterval  time.Duration `koanf:"scan_interval"`
}

type MessengersConfig added in v0.2.0

type MessengersConfig struct {
	Email SMTPConfig `koanf:"email"`
}

type Metrics

type Metrics struct {
	Enabled bool   `koanf:"enabled"`
	Path    string `koanf:"path"`
}

type OIDCConfig

type OIDCConfig struct {
	Issuer       string `koanf:"issuer"`
	AuthURL      string `koanf:"auth_url"`
	TokenURL     string `koanf:"token_url"`
	RedirectURL  string `koanf:"redirect_url"`
	ClientID     string `koanf:"client_id"`
	ClientSecret string `koanf:"client_secret"`
	Label        string `koanf:"label"`
}

type SMTPConfig added in v0.2.0

type SMTPConfig struct {
	Enabled     bool   `koanf:"enabled"`
	Host        string `koanf:"host"`
	Port        int    `koanf:"port"`
	Username    string `koanf:"username"`
	Password    string `koanf:"password"`
	FromAddress string `koanf:"from_address"`
	FromName    string `koanf:"from_name"`
	MaxConns    int    `koanf:"max_conns"`
	SSL         string `koanf:"ssl"` // none, tls, starttls
}

type SchedulerConfig

type SchedulerConfig struct {
	WorkerCount          int           `koanf:"workers"`
	Backend              string        `koanf:"backend"`
	CronSyncInterval     time.Duration `koanf:"cron_sync_interval"`
	FlowExecutionTimeout time.Duration `koanf:"flow_execution_timeout"`
}

Jump to

Keyboard shortcuts

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