Help us shape the future of Go! Take the 2026 Go Developer Survey

module

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(name string) *factory

func RegisterBuiltin

func RegisterBuiltin(name string, builtin BuiltIn)

Types

type BuiltIn

type BuiltIn interface {
	Module
	ApplyVariables(vars variable.Collection)
	Clone(name string) BuiltIn
}

type File

type File interface {
	Target() string
	RenderTemplate() (string, error)
}

func NewMemoryFile

func NewMemoryFile(target string, template string, enableTemplating bool, vars variable.Collection) File

type FileDiff

type FileDiff interface {
	Module() Module
	Path() string
	Operation() FileOperation
	Before() string
	After() string
	Print(withContent bool)
	Apply() error
}

type FileOperation

type FileOperation uint8
const (
	OpUnknown FileOperation = iota
	OpCreate
	OpUpdate
	OpDelete
)

type Module

type Module interface {
	Name() string
	Path() string
	Children() []Module
	Files() []File
	Validate() error
	RequiresUpdate() bool
	RequiresInstall() bool
	Install() error
	Update() error
	AfterFileChange() error
}

func LoadRoot

func LoadRoot() (Module, error)

type ModuleDiff

type ModuleDiff interface {
	Module() Module
	Before() State
	After() State
	Print(withContent bool)
	Apply() error
	Files() []FileDiff
}

func Diff

func Diff(m Module) ([]ModuleDiff, error)

type Runner

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

func NewRunner

func NewRunner(module Module, operation string) *Runner

func (*Runner) Run

func (r *Runner) Run(command string, sudo bool) error

type State

type State uint8
const (
	StateUnknown State = iota
	StateUninstalled
	StateInstalled
	StateUpdated
)

Jump to

Keyboard shortcuts

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