Documentation
¶
Overview ¶
Package config provides typed configuration management for the GitOps agent, using environment variables as the source of truth.
Index ¶
Constants ¶
View Source
const ( // StatusSuccess represents a successfully completed deployment. StatusSuccess = "success" // StatusFailed represents a deployment that encountered an error. StatusFailed = "failed" // StatusRollback represents a state where the system was reverted to a previous version. StatusRollback = "rollback" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// RepoURL is the URL of the remote Git repository to monitor.
RepoURL string
// Interval defines how often the agent checks for new commits.
Interval time.Duration
// LocalPath is the directory where the repository is cloned for analysis.
LocalPath string
// DBPath is the file path to the SQLite deployment history database.
DBPath string
// DiscordWebhookURL is the endpoint for sending deployment alerts.
DiscordWebhookURL string
// WebhookPort is the HTTP port for the inbound webhook server.
WebhookPort string
// WebhookSecret is the HMAC key for validating GitHub webhook payloads.
WebhookSecret string
// SSHHost is the target machine address for deployments.
SSHHost string
// SSHUser is the username for the SSH connection.
SSHUser string
// SSHKeyPath is the absolute path to the private SSH key.
SSHKeyPath string
// SSHCommands is a list of commands to execute on a successful commit detection.
SSHCommands []string
// RollbackCommand is the command executed if the primary deployment fails.
RollbackCommand string
}
Config defines the configuration structure for the GitOps agent. It includes settings for Git, SSH, notifications, and storage.
func LoadConfig ¶
LoadConfig retrieves configuration from environment variables or applies default values. It returns a pointer to Config or an error if validation fails.
Click to show internal directories.
Click to hide internal directories.