config

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package config implements parsing and serialization for the quartz.yaml, environment and secrets required by the platform

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadRawConfig

func LoadRawConfig(ctx context.Context, configFile string) (*koanf.Koanf, error)

LoadRawConfig reads the specified configuration file and processes it into a Koanf map. It applies defaults, environment variables, and additional settings.

func LoadRawSecrets

func LoadRawSecrets(ctx context.Context, secretsFile string) (*koanf.Koanf, error)

LoadRawSecrets reads the secrets file and processes it into a Koanf map. It also loads credentials from environment variables.

Types

type Settings

type Settings struct {
	Config  schema.QuartzConfig  // The parsed Quartz configuration.
	Secrets schema.QuartzSecrets // The parsed Quartz secrets.
	// contains filtered or unexported fields
}

Settings is a wrapper for the main Quartz configuration and secrets.

func Load

func Load(ctx context.Context, configFile string, secretsFile string) (Settings, error)

Load reads the configuration and secrets files and parses them into a Settings instance.

func NewSettings

func NewSettings(c *koanf.Koanf, s *koanf.Koanf) (Settings, error)

NewSettings creates a new Settings instance by parsing the provided configuration and secrets maps. Returns an error if unmarshalling fails.

func (Settings) ConfigString

func (r Settings) ConfigString(key string) string

ConfigString retrieves a raw configuration value by its key.

func (Settings) SecretString

func (r Settings) SecretString(key string) string

SecretString retrieves a raw secret value by its key.

func (Settings) WriteJsonConfig

func (r Settings) WriteJsonConfig(path string, root string, indent bool) error

WriteJsonConfig writes the application configuration to a JSON file. Supports an optional root key and indentation for pretty printing.

func (Settings) WriteYamlConfig

func (r Settings) WriteYamlConfig(path string) error

WriteYamlConfig writes the application configuration to a YAML file.

Directories

Path Synopsis
Package schema defines all config types representing the processed quartz.yaml
Package schema defines all config types representing the processed quartz.yaml

Jump to

Keyboard shortcuts

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