config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigPath

func GetConfigPath(defaultPath string) string

GetConfigPath returns the appropriate config path based on environment variables or defaults

func ParseDuration

func ParseDuration(durationStr string) (time.Duration, error)

ParseDuration is a helper function to parse duration strings

Types

type AgentConfig

type AgentConfig struct {
	Agent            AgentInfoConfig        `yaml:"agent"`
	Server           ServerConfig           `yaml:"server"`
	ServerConnection ServerConnectionConfig `yaml:"server_connection"`
	Docker           DockerConfig           `yaml:"docker"`
	Stacks           StacksConfig           `yaml:"stacks"`
	Plugins          PluginConfig           `yaml:"plugins"`
	Security         SecurityConfig         `yaml:"security"`
}

AgentConfig represents the configuration for the agent

func CreateDefaultAgentConfig

func CreateDefaultAgentConfig() *AgentConfig

CreateDefaultAgentConfig creates a default agent configuration

func LoadAgentConfig

func LoadAgentConfig(configPath string) (*AgentConfig, error)

LoadAgentConfig loads the agent configuration from a YAML file

type AgentInfoConfig

type AgentInfoConfig struct {
	ID       string            `yaml:"id"`
	Hostname string            `yaml:"hostname"`
	Labels   map[string]string `yaml:"labels"`
}

AgentInfoConfig contains agent identification configuration

type AgentManagementConfig

type AgentManagementConfig struct {
	HeartbeatInterval string `yaml:"heartbeat_interval"`
	OfflineTimeout    string `yaml:"offline_timeout"`
	AutoDeregister    bool   `yaml:"auto_deregister"`
}

AgentManagementConfig contains agent management configuration

type CoreConfig

type CoreConfig struct {
	Server          ServerConfig          `yaml:"server"`
	Plugins         PluginConfig          `yaml:"plugins"`
	AgentManagement AgentManagementConfig `yaml:"agent_management"`
	PluginDir       string                `yaml:"plugin_dir"`
}

CoreConfig represents the configuration for the core server

func CreateDefaultCoreConfig

func CreateDefaultCoreConfig() *CoreConfig

CreateDefaultCoreConfig creates a default core configuration

func LoadCoreConfig

func LoadCoreConfig(configPath string) (*CoreConfig, error)

LoadCoreConfig loads the core server configuration from a YAML file

type DockerConfig

type DockerConfig struct {
	Socket     string `yaml:"socket"`
	APIVersion string `yaml:"api_version"`
}

DockerConfig contains Docker-related configuration

type PluginConfig

type PluginConfig struct {
	Enabled map[string]bool                   `yaml:"enabled"`
	Configs map[string]map[string]interface{} `yaml:"configs,omitempty"`
}

PluginConfig contains plugin-related configuration

type SecurityConfig

type SecurityConfig struct {
	ExecTimeout       string `yaml:"exec_timeout"`
	LogRetention      string `yaml:"log_retention"`
	TerminalRecording bool   `yaml:"terminal_recording"`
}

SecurityConfig contains security-related configuration

type ServerConfig

type ServerConfig struct {
	ListenAddr string    `yaml:"listen_addr"`
	TLS        TLSConfig `yaml:"tls"`
}

ServerConfig contains server-related configuration

type ServerConnectionConfig

type ServerConnectionConfig struct {
	CoreAddr string    `yaml:"core_addr"`
	TLS      TLSConfig `yaml:"tls"`
}

ServerConnectionConfig contains connection configuration to the core server

type StacksConfig

type StacksConfig struct {
	RootDir                 string `yaml:"root_dir"`
	MaxConcurrentOperations int    `yaml:"max_concurrent_operations"`
}

StacksConfig contains stack-related configuration

type TLSConfig

type TLSConfig struct {
	CertPath   string `yaml:"cert_path"`
	KeyPath    string `yaml:"key_path"`
	CAPath     string `yaml:"ca_path"`
	MinVersion string `yaml:"min_version"`
	ServerName string `yaml:"server_name"`
}

TLSConfig contains TLS-related configuration

Jump to

Keyboard shortcuts

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