config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNamespace  = errorx.NewNamespace("config")
	NotFoundError = ErrNamespace.NewType("not_found", errorx.NotFound())
)

Functions

func Initialize

func Initialize(path string) error

Initialize loads the configuration from the specified file.

Parameters:

  • path: The path to the configuration file.

Returns:

  • An error if the configuration cannot be loaded.

func OverrideAlloyConfig added in v0.7.0

func OverrideAlloyConfig(overrides AlloyConfig)

OverrideAlloyConfig updates the Alloy configuration with provided overrides. Empty string values are ignored (not applied). Note: Passwords are managed via Vault and External Secrets Operator.

func OverrideBlockNodeConfig added in v0.6.0

func OverrideBlockNodeConfig(overrides BlockNodeConfig)

OverrideBlockNodeConfig updates the block node configuration with provided overrides. Empty string values are ignored (not applied).

func OverrideTeleportConfig added in v0.7.0

func OverrideTeleportConfig(overrides TeleportConfig)

OverrideTeleportConfig updates the Teleport configuration with provided overrides. Empty string values are ignored (not applied).

func Set

func Set(c *Config) error

func SetProfile added in v0.7.0

func SetProfile(profile string)

SetProfile sets the deployment profile in the global configuration.

Types

type AlloyConfig added in v0.7.0

type AlloyConfig struct {
	MonitorBlockNode   bool   `yaml:"monitorBlockNode" json:"monitorBlockNode"`
	PrometheusURL      string `yaml:"prometheusUrl" json:"prometheusUrl"`
	PrometheusUsername string `yaml:"prometheusUsername" json:"prometheusUsername"`
	LokiURL            string `yaml:"lokiUrl" json:"lokiUrl"`
	LokiUsername       string `yaml:"lokiUsername" json:"lokiUsername"`
	ClusterName        string `yaml:"clusterName" json:"clusterName"`
}

AlloyConfig represents the `alloy` configuration block for observability. Note: Passwords are managed via Vault and External Secrets Operator, not in config files.

func (*AlloyConfig) Validate added in v0.7.0

func (c *AlloyConfig) Validate() error

Validate validates all Alloy configuration fields.

type BlockNodeConfig

type BlockNodeConfig struct {
	Namespace string           `yaml:"namespace" json:"namespace"`
	Release   string           `yaml:"release" json:"release"`
	Chart     string           `yaml:"chart" json:"chart"`
	Version   string           `yaml:"version" json:"version"`
	Storage   BlockNodeStorage `yaml:"storage" json:"storage"`
}

BlockNodeConfig represents the `blockNode` configuration block.

func (*BlockNodeConfig) Validate added in v0.6.0

func (c *BlockNodeConfig) Validate() error

Validate validates all block node configuration fields to ensure they are safe and secure. This performs early validation of user-provided configuration to catch security issues before workflow execution begins.

type BlockNodeStorage

type BlockNodeStorage struct {
	BasePath         string `yaml:"basePath" json:"basePath"`
	ArchivePath      string `yaml:"archivePath" json:"archivePath"`
	LivePath         string `yaml:"livePath" json:"livePath"`
	LogPath          string `yaml:"logPath" json:"logPath"`
	VerificationPath string `yaml:"verificationPath" json:"verificationPath"`
	LiveSize         string `yaml:"liveSize" json:"liveSize"`
	ArchiveSize      string `yaml:"archiveSize" json:"archiveSize"`
	LogSize          string `yaml:"logSize" json:"logSize"`
	VerificationSize string `yaml:"verificationSize" json:"verificationSize"`
}

BlockNodeStorage represents the `storage` section under `blockNode`.

func (*BlockNodeStorage) Validate added in v0.6.0

func (s *BlockNodeStorage) Validate() error

Validate validates all storage paths to ensure they are safe and secure. This performs early validation of user-provided paths to catch security issues before workflow execution begins.

type Config

type Config struct {
	Profile   string             `yaml:"profile" json:"profile"` // Deployment profile (local, perfnet, testnet, mainnet)
	Log       logx.LoggingConfig `yaml:"log" json:"log"`
	BlockNode BlockNodeConfig    `yaml:"blockNode" json:"blockNode"`
	Alloy     AlloyConfig        `yaml:"alloy" json:"alloy"`
	Teleport  TeleportConfig     `yaml:"teleport" json:"teleport"`
}

Config holds the global configuration for the application.

func Get

func Get() Config

Get returns the loaded configuration.

Returns:

  • The global configuration.

func (Config) IsLocalProfile added in v0.7.0

func (c Config) IsLocalProfile() bool

IsLocalProfile returns true if the current profile is the local development profile.

func (Config) Validate added in v0.6.0

func (c Config) Validate() error

Validate validates all configuration fields to ensure they are safe and secure.

type TeleportConfig added in v0.7.0

type TeleportConfig struct {
	Version            string `yaml:"version" json:"version"`                       // Helm chart version for cluster agent
	ValuesFile         string `yaml:"valuesFile" json:"valuesFile"`                 // Path to Helm values file for cluster agent
	NodeAgentToken     string `yaml:"nodeAgentToken" json:"nodeAgentToken"`         // Join token for host-level SSH agent
	NodeAgentProxyAddr string `yaml:"nodeAgentProxyAddr" json:"nodeAgentProxyAddr"` // Teleport proxy address (required when NodeAgentToken is set)
}

TeleportConfig represents the `teleport` configuration block for secure access. Teleport configuration for node agent and cluster agent. Node agent: Uses NodeAgentToken and NodeAgentProxyAddr Cluster agent: Uses Version and ValuesFile (passed directly to Helm)

func (TeleportConfig) Validate added in v0.7.0

func (c TeleportConfig) Validate() error

Validate validates Teleport configuration fields that are set. This performs basic validation without context-specific requirements. Use ValidateClusterAgent() or ValidateNodeAgent() for use-case specific validation.

func (TeleportConfig) ValidateClusterAgent added in v0.7.0

func (c TeleportConfig) ValidateClusterAgent() error

ValidateClusterAgent validates configuration for the cluster agent.

func (TeleportConfig) ValidateNodeAgent added in v0.7.0

func (c TeleportConfig) ValidateNodeAgent() error

ValidateNodeAgent validates configuration for the node agent.

Jump to

Keyboard shortcuts

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