config

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DefaultMCPMaxBodySize = 1024 * 1024
View Source
const DefaultMaxFlowImportSize = 256 * 1024
View Source
const DefaultMaxNodeImportSize = 1 << 20 // 1MB

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	AdminUsername     string         `koanf:"admin_username" validate:"required,min=1"`
	AdminPassword     string         `koanf:"admin_password" validate:"required,min=8"`
	RootURL           string         `koanf:"root_url" validate:"required,url"`
	Address           string         `koanf:"address" validate:"required"`
	UseTLS            bool           `koanf:"use_tls"`
	HTTPTLSCert       string         `koanf:"http_tls_cert" validate:"required_if=UseTLS true"`
	HTTPTLSKey        string         `koanf:"http_tls_key" validate:"required_if=UseTLS true"`
	FlowsDirectory    string         `koanf:"flows_directory" validate:"required"`
	MaxFileUploadSize int64          `koanf:"max_file_upload_size" validate:"required,min=1"`
	MaxFlowImportSize int64          `koanf:"max_flow_import_size" validate:"min=0"`
	MaxNodeImportSize int64          `koanf:"max_node_import_size" validate:"min=0"`
	PluginDir         string         `koanf:"plugin_dir"`
	Branding          BrandingConfig `koanf:"branding"`
}

type BrandingConfig added in v0.14.0

type BrandingConfig struct {
	AppName      string `koanf:"app_name"`
	LogoURL      string `koanf:"logo_url"`
	LogoLightURL string `koanf:"logo_light_url"`
	IconURL      string `koanf:"icon_url"`
	FaviconURL   string `koanf:"favicon_url"`
	BrandingDir  string `koanf:"branding_dir"`
}

type ChatConfig added in v0.15.0

type ChatConfig struct {
	Enabled bool          `koanf:"enabled"`
	Timeout time.Duration `koanf:"timeout"`
}

type Config

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

func GetDefaultConfig

func GetDefaultConfig() Config

GetDefaultConfig returns the default configuration values

func Load

func Load(configPath string) (Config, error)

func (*Config) Validate added in v0.6.0

func (c *Config) Validate() error

type DBConfig

type DBConfig struct {
	DSN         string `koanf:"dsn"`
	DBName      string `koanf:"dbname" validate:"required_without=DSN"`
	User        string `koanf:"user" validate:"required_without=DSN"`
	Password    string `koanf:"password" validate:"required_without=DSN"`
	Host        string `koanf:"host" validate:"required_without=DSN"`
	Port        int    `koanf:"port" validate:"required_without=DSN,omitempty,min=1,max=65535"`
	SSLMode     string `koanf:"sslmode" validate:"omitempty,oneof=disable allow prefer require verify-ca verify-full"`
	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" validate:"required"`
}

type Logger

type Logger struct {
	Backend       string        `koanf:"backend"`
	Directory     string        `koanf:"log_directory" validate:"required"`
	MaxSizeBytes  int64         `koanf:"max_size_bytes" validate:"min=0"`
	RetentionTime time.Duration `koanf:"retention_time" validate:"min=0"`
	ScanInterval  time.Duration `koanf:"scan_interval" validate:"min=1s"`
}

type MCPConfig added in v0.16.0

type MCPConfig struct {
	Enabled     bool  `koanf:"enabled"`
	MaxBodySize int64 `koanf:"max_body_size" validate:"min=0"`
}

type MessengersConfig added in v0.2.0

type MessengersConfig struct {
	Email   SMTPConfig    `koanf:"email"`
	Webhook WebhookConfig `koanf:"webhook"`
	Chat    ChatConfig    `koanf:"chat"`
}

type Metrics

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

type OIDCAutoCreateConfig added in v0.9.0

type OIDCAutoCreateConfig struct {
	Enabled        bool     `koanf:"enabled"`
	Namespace      string   `koanf:"namespace"`
	Role           string   `koanf:"role"`
	Groups         []string `koanf:"groups"`
	AllowedDomains []string `koanf:"allowed_domains"`
}

type OIDCConfig

type OIDCConfig struct {
	Name            string               `koanf:"name" validate:"required,alpha"`
	Issuer          string               `koanf:"issuer" validate:"required,url"`
	AuthURL         string               `koanf:"auth_url" validate:"omitempty,url"`
	TokenURL        string               `koanf:"token_url" validate:"omitempty,url"`
	LogoutEnabled   bool                 `koanf:"logout_enabled"`
	LogoutURL       string               `koanf:"logout_url" validate:"omitempty,url"`
	RedirectURL     string               `koanf:"redirect_url" validate:"omitempty,url"`
	ClientID        string               `koanf:"client_id" validate:"required"`
	ClientSecret    string               `koanf:"client_secret" validate:"required"`
	Label           string               `koanf:"label"`
	AutoCreateUsers OIDCAutoCreateConfig `koanf:"auto_create_users"`
}

type SMTPConfig added in v0.2.0

type SMTPConfig struct {
	Enabled     bool   `koanf:"enabled"`
	Host        string `koanf:"host" validate:"required_if=Enabled true"`
	Port        int    `koanf:"port" validate:"required_if=Enabled true,min=1,max=65535"`
	Username    string `koanf:"username"`
	Password    string `koanf:"password"`
	FromAddress string `koanf:"from_address" validate:"required_if=Enabled true,email"`
	FromName    string `koanf:"from_name"`
	MaxConns    int    `koanf:"max_conns" validate:"min=1"`
	SSL         string `koanf:"ssl" validate:"omitempty,oneof=none tls starttls"`
}

type SchedulerConfig

type SchedulerConfig struct {
	WorkerCount                int           `koanf:"workers" validate:"min=1"`
	Backend                    string        `koanf:"backend"`
	CronSyncInterval           time.Duration `koanf:"cron_sync_interval" validate:"min=1s"`
	FlowExecutionTimeout       time.Duration `koanf:"flow_execution_timeout" validate:"min=1s"`
	MaxParallel                int           `koanf:"max_parallel" validate:"min=0"`
	DefaultTimezone            string        `koanf:"default_timezone" validate:"required,timezone"`
	ExecutionRetentionTime     time.Duration `koanf:"execution_retention_time" validate:"min=0"`
	ExecutionRetentionInterval time.Duration `koanf:"execution_retention_interval" validate:"omitempty,min=1m"`
}

type WebhookConfig added in v0.8.0

type WebhookConfig struct {
	Enabled    bool          `koanf:"enabled"`
	SigningKey string        `koanf:"signing_key" validate:"required_if=Enabled true"`
	Timeout    time.Duration `koanf:"timeout"`
}

Jump to

Keyboard shortcuts

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