config

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 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"`
}

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"`
}

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 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 SchedulerConfig

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

Jump to

Keyboard shortcuts

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