config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadVariables

func ReadVariables(path string) (map[string]interface{}, error)

ReadVariables is a convenience function using the default YAML reader

Types

type ConfigReader

type ConfigReader interface {
	ReadConfig(path string) ([]Step, error)
	ReadVariables(path string) (map[string]interface{}, error)
}

ConfigReader defines the interface for reading configuration and variables

func NewYAMLConfigReader

func NewYAMLConfigReader() ConfigReader

NewYAMLConfigReader creates a new YAMLConfigReader

type File

type File struct {
	Path    string `yaml:"path"`
	State   string `yaml:"state"`
	Content string `yaml:"content"`
	Mode    string `yaml:"mode"` // Octal file permissions (e.g., "0644", "0755")
}

type Shell

type Shell struct {
	Command string `yaml:"command"`
}

type Step

type Step struct {
	Name         string                  `yaml:"name"`
	When         string                  `yaml:"when"`
	Template     *Template               `yaml:"template"`
	File         *File                   `yaml:"file"`
	Shell        *string                 `yaml:"shell"`
	Include      *string                 `yaml:"include"`
	IncludeVars  *string                 `yaml:"include_vars"`
	Become       bool                    `yaml:"become"`
	Vars         *map[string]interface{} `yaml:"vars"`
	Tags         []string                `yaml:"tags"`
	WithFileTree *string                 `yaml:"with_filetree"`
	WithItems    *string                 `yaml:"with_items"`
}

func ReadConfig

func ReadConfig(path string) ([]Step, error)

ReadConfig is a convenience function using the default YAML reader

func (*Step) Copy

func (s *Step) Copy() *Step

func (*Step) Validate

func (s *Step) Validate() error

func (*Step) ValidateHasAction

func (s *Step) ValidateHasAction() error

func (*Step) ValidateOneAction

func (s *Step) ValidateOneAction() error

type Template

type Template struct {
	Src  string                  `yaml:"src"`
	Dest string                  `yaml:"dest"`
	Vars *map[string]interface{} `yaml:"vars"`
	Mode string                  `yaml:"mode"` // Octal file permissions (e.g., "0644", "0755")
}

type YAMLConfigReader

type YAMLConfigReader struct {
}

YAMLConfigReader implements ConfigReader for YAML files

func (*YAMLConfigReader) ReadConfig

func (r *YAMLConfigReader) ReadConfig(path string) ([]Step, error)

ReadConfig reads configuration steps from a YAML file

func (*YAMLConfigReader) ReadVariables

func (r *YAMLConfigReader) ReadVariables(path string) (map[string]interface{}, error)

ReadVariables reads variables from a YAML file

Jump to

Keyboard shortcuts

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