config

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfigFile

func LoadConfigFile(dataStruct interface{}, meta *Metadata, configFilePath string) error

LoadConfigFile reads, parses and validates specified configuration file.

func SaveConfigFile

func SaveConfigFile(data interface{}, configFilePath string) error

SaveConfigFile validates, serializes and saves configuration to a file.

Types

type GenericConfigFile

type GenericConfigFile struct {
	// Meta stores metadata of the config file (such as a path).
	Meta Metadata `yaml:"-"`
	// APIVersion can be used to handle more than one config file format
	APIVersion string `yaml:"apiVersion"`
	// Kind of the config file
	Kind string `yaml:"kind"`
}

type Metadata

type Metadata struct {
	Path   string
	Exists bool
}

Metadata contains context and additional info for configuration files.

Jump to

Keyboard shortcuts

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