config

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package config defines a configuration engine based on JavaScript. A configuration is built from a set of JavaScript source files and executed to generate a state object, which is provided to components such as the reconfigurer for resolving state changes. JavaScript is used so certain common expressions can be re-used, or targets can be conditionally resolved based on input variables such as the machine's hostname.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthMethod added in v1.4.0

type AuthMethod struct {
	Name    string `json:"name"`     // name of the auth method
	Path    string `json:"path"`     // path within the secret store
	UserKey string `json:"user_key"` // key for username
	PassKey string `json:"pass_key"` // key for password
}

AuthMethod represents a method of authentication for a target

type State

type State struct {
	Targets     task.Targets      `json:"targets"`
	AuthMethods []AuthMethod      `json:"auths"`
	Env         map[string]string `json:"env"`
}

State represents a desired system state

func ConfigFromDirectory

func ConfigFromDirectory(dir, hostname string) (state State, err error)

ConfigFromDirectory searches a directory for configuration files and constructs a desired state from the declarations.

Jump to

Keyboard shortcuts

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