config

package
v0.8.6-14-g82b26f0d Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package config provides facilities for manipulating kraftkit configuration files on the local filesystem.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// contains filtered or unexported fields
}

Config is a YAML-serializable kraftkit configuration. It provides facilities for reading and writing individual configuration attributes from/to a file.

This type is purposely decoupled from kraftkit's internal configuration facilities to allow testing the CLI from an outside perspective, independently from kraftkit's internal implementation.

func NewTempConfig

func NewTempConfig() *Config

NewTempConfig creates a temporary kraftkit configuration file on the local filesystem, pre-populated with a "paths" configuration section referencing temporary directories.

A ginkgo cleanup node is automatically created to handle the removal of the (temporary) parent directory of this configuration file.

func (*Config) Path

func (c *Config) Path() string

Path returns the path to the kraftkit configuration.

func (*Config) Read

func (c *Config) Read(yamlPath ...string) *yaml.RNode

Read returns the YAML node at the given YAML path from the configuration.

func (*Config) Write

func (c *Config) Write(filters ...yaml.Filter)

Write writes configuration changes by executing the given YAML filters.

Jump to

Keyboard shortcuts

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