core

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const EnvPrefix = "MMDOT_"

Variables

This section is empty.

Functions

This section is empty.

Types

type Age added in v0.3.0

type Age struct {
	Recipients   []string `yaml:"recipients"`
	IdentityFile string   `yaml:"identity_file"`
}

func (Age) ReadIdentity added in v0.3.0

func (a Age) ReadIdentity() (age.Identity, error)

type Brews added in v0.3.0

type Brews struct {
	Remove   bool     `yaml:"remove"`
	Outfile  string   `yaml:"outfile"`
	Includes []string `yaml:"includes"`
	Brews    []string `yaml:"brews"`
	Taps     []string `yaml:"taps"`
	Casks    []string `yaml:"casks"`
	MAS      []string `yaml:"mas"`
}

func (*Brews) Diff added in v0.3.0

func (c *Brews) Diff() (*DiffResult, error)

Diff returns a comparison between the brews in the Config and those installed on the machine. It categorizes brews into: - Present: Items in config and installed on the machine - Absent: Items in config but not installed on the machine - Extra: Items installed on the machine but not in the config (drift detection)

func (*Brews) String added in v0.3.0

func (c *Brews) String() string

String returns a shell script to install the taps and brews

type ConfigFile added in v0.3.0

type ConfigFile struct {
	Macros    map[string]string `yaml:"macros"`
	Exec      Exec              `yaml:"exec"`
	Age       Age               `yaml:"age"`
	Brews     ConfigMap         `yaml:"brews"`
	Variables Variables         `yaml:"variables"`
	Templates []Template        `yaml:"templates"`
	ConfigDir string            `yaml:"-"` // Directory containing the config file (not serialized)
}

func SetupEnv added in v0.3.0

func SetupEnv(cfgpath string) (ConfigFile, error)

func (ConfigFile) EncryptedFiles added in v0.3.0

func (c ConfigFile) EncryptedFiles() []string

Returns a list of all files that should to be encrypted

type ConfigMap added in v0.3.0

type ConfigMap map[string]*Brews

func (ConfigMap) Get added in v0.3.0

func (cm ConfigMap) Get(key string) *Brews

type DiffResult added in v0.3.0

type DiffResult struct {
	Present []string // Present on machine
	Absent  []string // Absent from machine
	Extra   []string // Present in config, Absent from machine
}

type Exec added in v0.3.0

type Exec struct {
	Shell   string   `yaml:"shell"`
	Scripts []Script `yaml:"scripts"`
}

ExecConfig represents the shell execution configuration

type Flags

type Flags struct {
	LogLevel       string
	ConfigFilePath string
}

type PathResolver added in v0.3.0

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

PathResolver provides a resolving service for paths that turns a relative or paths with '~' type symbols into absolute paths.

func (PathResolver) Resolve added in v0.3.0

func (pr PathResolver) Resolve(ip string) (string, error)

type Script added in v0.3.0

type Script struct {
	Path string   `yaml:"path"`
	Tags []string `yaml:"tags"`
}

Script represents a single executable script with associated tags

type Template added in v0.3.0

type Template struct {
	Name        string         `yaml:"name"`
	Tags        []string       `yaml:"tags"`
	Template    string         `yaml:"template"` // File or Template
	Output      string         `yaml:"output"`
	Permissions string         `yaml:"perm"` // Must be valid permissions
	Vars        map[string]any `yaml:"vars"`
	Trim        *bool          `yaml:"trim"` // Trim leading/trailing whitespace from output (default: true)
}

func (Template) ShouldTrim added in v0.3.0

func (t Template) ShouldTrim() bool

type VarFile added in v0.3.0

type VarFile struct {
	Path    string
	IsVault bool
}

func (*VarFile) UnmarshalYAML added in v0.3.0

func (vf *VarFile) UnmarshalYAML(unmarshal func(any) error) error

type Variables added in v0.3.0

type Variables struct {
	VarFiles []VarFile      `yaml:"var_files"`
	Vars     map[string]any `yaml:"vars"`
}

Jump to

Keyboard shortcuts

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