config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(appConfig *Config) error

ValidateConfig verifies that the loaded configuration contains all required values.

Types

type Config

type Config struct {
	AgentID       string                      `yaml:"agent_id"`
	APIToken      string                      `yaml:"api_token"`
	NodeID        string                      `yaml:"node_id"`
	NodeName      string                      `yaml:"node_name"`
	NodeRegion    string                      `yaml:"node_region"`
	Environment   string                      `yaml:"environment"`
	WorkspacePath string                      `yaml:"workspace_path"`
	LogLevel      string                      `yaml:"log_level"`
	Deployments   map[string]DeploymentConfig `yaml:"deployments"`
}

Config represents the root application configuration for the agent.

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig reads and parses an agent configuration file from disk.

type DeployStepConfig

type DeployStepConfig struct {
	Type              string   `yaml:"type"`
	Name              string   `yaml:"name"`
	Command           string   `yaml:"command"`
	Arguments         []string `yaml:"arguments"`
	TimeoutSeconds    int      `yaml:"timeout_seconds"`
	WorkingDirectory  string   `yaml:"working_directory"`
	Retries           int      `yaml:"retries"`
	RetryDelaySeconds int      `yaml:"retry_delay_seconds"`
	ProcessName       string   `yaml:"process_name"`
	StartCommand      string   `yaml:"start_command"`
	URL               string   `yaml:"url"`
	ExpectedStatus    int      `yaml:"expected_status"`
}

DeployStepConfig represents a single shell-based deployment step loaded from YAML.

func ExpandedDeploymentSteps

func ExpandedDeploymentSteps(
	deployment DeploymentConfig,
) ([]DeployStepConfig, error)

ExpandedDeploymentSteps returns the final deployment step list.

If a deployment uses a preset, the preset is expanded into concrete steps. If no preset is provided, the manually configured steps are returned.

type DeploymentConfig

type DeploymentConfig struct {
	RepositoryPath            string             `yaml:"repository_path"`
	Preset                    string             `yaml:"preset"`
	ProcessName               string             `yaml:"process_name"`
	HealthCheckURL            string             `yaml:"health_check_url"`
	HealthCheckExpectedStatus int                `yaml:"health_check_expected_status"`
	Steps                     []DeployStepConfig `yaml:"steps"`
}

DeploymentConfig defines the repository and step configuration used during deployment.

Jump to

Keyboard shortcuts

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