tomlx

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package tomlx provides utilities for managing TOML configuration files.

This package offers a TomlConfigManager that can: - Read and update existing TOML files while preserving structure - Merge configuration maps recursively - Set nested configuration values using dot notation paths - Validate TOML configurations against expected values

It is primarily used by software installers to patch configuration files with sandbox-specific paths while maintaining the original structure.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TomlConfigManager

type TomlConfigManager struct{}

TomlConfigManager provides utilities for managing TOML configuration files

func NewTomlConfigManager

func NewTomlConfigManager() *TomlConfigManager

NewTomlConfigManager creates a new TOML configuration manager

func (*TomlConfigManager) MergeConfigMaps

func (tcm *TomlConfigManager) MergeConfigMaps(target, source map[string]interface{})

MergeConfigMaps recursively merges the source config into the target config

func (*TomlConfigManager) SetNestedValue

func (tcm *TomlConfigManager) SetNestedValue(config map[string]interface{}, path string, value interface{})

SetNestedValue safely sets nested values in a map, creating intermediate maps as needed The value can be a string, slice, or any other type

func (*TomlConfigManager) UpdateTomlFile

func (tcm *TomlConfigManager) UpdateTomlFile(filePath string, configUpdates map[string]interface{}) error

UpdateTomlFile reads a TOML file, applies configuration updates, and writes it back

func (*TomlConfigManager) ValidateConfigValues

func (tcm *TomlConfigManager) ValidateConfigValues(actual map[string]any, expected map[string]interface{}) bool

ValidateConfigValues recursively validates that the actual TOML config matches the expected config

Jump to

Keyboard shortcuts

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