modules

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StrategyMerge   = "merge"
	StrategyReplace = "replace"
	SymlinkDeep     = "deep"
	SymlinkShallow  = "shallow"
	SymlinkSkip     = "skip"
)
View Source
const ABOUT_CACHE_KEY = "annotation:about"
View Source
const AUTEUR_MODUlES = "Modules"

@auteur("Helpers")

Helper functions

Helper functions look similar to modules in the sense that they are also Lua functions. The key difference is that helper functions get **executed immediatly** during the Blueprint creation, and are *not* part of the generated blueprints.

Some common use cases involve reading from files, string manipulation or http requests.

Helpers are **always lowercased** (e.g. `read`)

View Source
const AUTEUR_UTILS = "Utils"

Variables

This section is empty.

Functions

func Backup

func Backup(originalPath string) error

func BlockInFile

func BlockInFile(props BlockOpts) error

func BlockInString

func BlockInString(text string, opts BlockOpts) string

func Copy

func Copy(opts CopyOpts) error

func HomebrewMod

func HomebrewMod(glue *core.Glue) error

Types

type BlockOpts

type BlockOpts struct {
	Block        string `json:"block"`
	Insertafter  string `json:"insertafter"`
	Insertbefore string `json:"insertbefore"`
	Marker       string `json:"marker"`
	Markerbegin  string `json:"markerbegin"`
	Markerend    string `json:"markerend"`
	State        bool   `json:"state"`
	Backup       bool   `json:"backup"`
	Create       bool   `json:"create"`
	Path         string `json:"path"`
}

type CopyOpts

type CopyOpts struct {
	Strategy      string `json:"strategy"`
	Symlink       string `json:"symlink"`
	PreserveOwner bool   `json:"preserve_owner"`
	Source        string `json:"source"`
	Dest          string `json:"dest"`
}

type ModuleInstaller

type ModuleInstaller func(glue *core.Glue) error

type ModuleRegistry

type ModuleRegistry struct {
	// contains filtered or unexported fields
}
var Registry *ModuleRegistry = NewModuleRegistry()

func NewModuleRegistry

func NewModuleRegistry() *ModuleRegistry

func (*ModuleRegistry) InstallModules

func (r *ModuleRegistry) InstallModules(glue *core.Glue) error

InstallModules installs all the modules in the registry onto the Glue instance

func (*ModuleRegistry) RegisterModule

func (r *ModuleRegistry) RegisterModule(mod ModuleInstaller)

RegisterModule adds a module installer to the registry The installer is a function that installs the modules onto the Glue instance

Jump to

Keyboard shortcuts

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