config

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 24, 2025 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertflowConfig

type AlertflowConfig struct {
	Enabled  bool   `mapstructure:"enabled"`
	URL      string `mapstructure:"url" validate:"required,url"`
	RunnerID string `mapstructure:"runner_id"`
	APIKey   string `mapstructure:"api_key" validate:"required"`
}

type ApiEndpointConfig added in v1.1.0

type ApiEndpointConfig struct {
	Port int `mapstructure:"port" validate:"required,min=1024,max=65535"`
}

type Config

type Config struct {
	LogLevel     string            `mapstructure:"log_level" validate:"required,oneof=debug info warn error"`
	Mode         string            `mapstructure:"mode" validate:"required,oneof=master worker"`
	Alertflow    AlertflowConfig   `mapstructure:"alertflow" validate:"required"`
	ExFlow       exflowConfig      `mapstructure:"exflow" validate:"required"`
	ApiEndpoint  ApiEndpointConfig `mapstructure:"api_endpoint" validate:"required"`
	WorkspaceDir string            `mapstructure:"workspace_dir" validate:"dir"`
	PluginDir    string            `mapstructure:"plugin_dir" validate:"dir"`
	Plugins      []PluginConfig    `mapstructure:"plugins"`
}

Config represents the application configuration

type ConfigurationManager

type ConfigurationManager struct {
	// contains filtered or unexported fields
}

ConfigurationManager handles all configuration operations

func GetInstance

func GetInstance() *ConfigurationManager

GetInstance returns the singleton configuration manager instance

func (*ConfigurationManager) GetConfig

func (cm *ConfigurationManager) GetConfig() Config

GetConfig returns a copy of the current configuration

func (*ConfigurationManager) GetRunnerID

func (cm *ConfigurationManager) GetRunnerID(platform string) string

GetRunnerIDs returns the current runner IDs for both Alertflow and ExFlow

func (*ConfigurationManager) LoadConfig

func (cm *ConfigurationManager) LoadConfig(configFile string) error

LoadConfig initializes the configuration from file and environment

func (*ConfigurationManager) ReloadConfig

func (cm *ConfigurationManager) ReloadConfig() error

ReloadConfig reloads the configuration from the file

func (*ConfigurationManager) UpdateRunnerID

func (cm *ConfigurationManager) UpdateRunnerID(platform, id string)

UpdateRunnerID updates the runner ID in the configuration for both Alertflow and ExFlow

type PluginConfig

type PluginConfig struct {
	Name    string `mapstructure:"name" validate:"required"`
	Url     string `mapstructure:"url" validate:"required,url"`
	Version string `mapstructure:"version" validate:"required"`
}

Jump to

Keyboard shortcuts

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