config

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvKeyPrefix    = "VEF"
	EnvNodeID       = EnvKeyPrefix + "_NODE_ID"       // XID node identifier
	EnvLogLevel     = EnvKeyPrefix + "_LOG_LEVEL"     // Log level (debug|info|warn|error)
	EnvConfigPath   = EnvKeyPrefix + "_CONFIG_PATH"   // Custom config file path
	EnvI18NLanguage = EnvKeyPrefix + "_I18N_LANGUAGE" // Override default language
)

Environment variable keys.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Name      string `config:"name"`
	Port      uint16 `config:"port"`
	BodyLimit string `config:"body_limit"`
}

AppConfig defines core application settings.

type ApprovalConfig

type ApprovalConfig struct {
	AutoMigrate         bool `config:"auto_migrate"`
	OutboxRelayInterval int  `config:"outbox_relay_interval"` // Polling interval in seconds (default: 5)
	OutboxMaxRetries    int  `config:"outbox_max_retries"`    // Max retry attempts (default: 10)
	OutboxBatchSize     int  `config:"outbox_batch_size"`     // Max events per poll (default: 100)
}

ApprovalConfig defines approval workflow engine settings.

func (*ApprovalConfig) OutboxBatchSizeOrDefault

func (c *ApprovalConfig) OutboxBatchSizeOrDefault() int

OutboxBatchSizeOrDefault returns the batch size, defaulting to 100.

func (*ApprovalConfig) OutboxMaxRetriesOrDefault

func (c *ApprovalConfig) OutboxMaxRetriesOrDefault() int

OutboxMaxRetriesOrDefault returns the max retries, defaulting to 10.

func (*ApprovalConfig) OutboxRelayIntervalOrDefault

func (c *ApprovalConfig) OutboxRelayIntervalOrDefault() int

OutboxRelayIntervalOrDefault returns the relay interval, defaulting to 5 seconds.

type Config

type Config interface {
	// Unmarshal decodes configuration at the given key into target.
	Unmarshal(key string, target any) error
}

Config provides access to application configuration values.

type CorsConfig

type CorsConfig struct {
	Enabled      bool     `config:"enabled"`
	AllowOrigins []string `config:"allow_origins"`
}

CorsConfig defines CORS middleware settings.

type DBKind

type DBKind string

DBKind represents supported database kinds.

const (
	Oracle    DBKind = "oracle"
	SQLServer DBKind = "sqlserver"
	Postgres  DBKind = "postgres"
	MySQL     DBKind = "mysql"
	SQLite    DBKind = "sqlite"
)

Supported database kinds.

type DataSourceConfig

type DataSourceConfig struct {
	Kind           DBKind `config:"type"`
	Host           string `config:"host"`
	Port           uint16 `config:"port"`
	User           string `config:"user"`
	Password       string `config:"password"`
	Database       string `config:"database"`
	Schema         string `config:"schema"`
	Path           string `config:"path"`
	EnableSQLGuard bool   `config:"enable_sql_guard"`
}

DataSourceConfig defines database connection settings.

type FilesystemConfig

type FilesystemConfig struct {
	Root string `config:"root"`
}

FilesystemConfig defines filesystem storage settings.

type MCPConfig

type MCPConfig struct {
	Enabled     bool `config:"enabled"`
	RequireAuth bool `config:"require_auth"`
}

MCPConfig defines MCP server settings.

type MinIOConfig

type MinIOConfig struct {
	Endpoint  string `config:"endpoint"`
	AccessKey string `config:"access_key"`
	SecretKey string `config:"secret_key"`
	Bucket    string `config:"bucket"`
	Region    string `config:"region"`
	UseSSL    bool   `config:"use_ssl"`
}

MinIOConfig defines MinIO storage settings.

type MonitorConfig

type MonitorConfig struct {
	SampleInterval time.Duration `config:"sample_interval"` // Interval between samples (default: 10s)
	SampleDuration time.Duration `config:"sample_duration"` // Sampling window duration (default: 2s)
}

MonitorConfig defines monitoring service settings.

type RedisConfig

type RedisConfig struct {
	Host     string `config:"host"`
	Port     uint16 `config:"port"`
	User     string `config:"user"`
	Password string `config:"password"`
	Database uint8  `config:"database"` // Database number (0-15)
	Network  string `config:"network"`  // "tcp" or "unix" (default: "tcp")
}

RedisConfig defines Redis connection settings.

type SecurityConfig

type SecurityConfig struct {
	TokenExpires     time.Duration `config:"token_expires"`
	RefreshNotBefore time.Duration `config:"refresh_not_before"`
	LoginRateLimit   int           `config:"login_rate_limit"`
	RefreshRateLimit int           `config:"refresh_rate_limit"`
}

SecurityConfig defines security settings.

type StorageConfig

type StorageConfig struct {
	Provider   StorageProvider  `config:"provider"`
	MinIO      MinIOConfig      `config:"minio"`
	Filesystem FilesystemConfig `config:"filesystem"`
}

StorageConfig defines storage provider settings.

type StorageProvider

type StorageProvider string

StorageProvider represents supported storage backend types.

const (
	StorageMinIO      StorageProvider = "minio"
	StorageMemory     StorageProvider = "memory"
	StorageFilesystem StorageProvider = "filesystem"
)

Supported storage providers.

Jump to

Keyboard shortcuts

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