config

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 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 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 Set

func Set(c *Config) error

Types

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"`
	LiveSize    string `yaml:"liveSize" json:"liveSize"`
	ArchiveSize string `yaml:"archiveSize" json:"archiveSize"`
	LogSize     string `yaml:"logSize" json:"logSize"`
}

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 {
	Log       logx.LoggingConfig `yaml:"log" json:"log"`
	BlockNode BlockNodeConfig    `yaml:"blockNode" json:"blockNode"`
}

Config holds the global configuration for the application.

func Get

func Get() Config

Get returns the loaded configuration.

Returns:

  • The global configuration.

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.

Jump to

Keyboard shortcuts

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