module

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidModule = errors.New("unknown module")

Functions

This section is empty.

Types

type ActionsUnion

type ActionsUnion struct {
	Copy *CopyAction `json:"copy,omitempty"`
	Run  *RunAction  `json:"run,omitempty"`
}

ActionsUnion Union class to hold different actions

func (ActionsUnion) Activate

func (then ActionsUnion) Activate() (err error)

type ComposerMap

type ComposerMap struct {
	Map
}

func (ComposerMap) Install

func (ComposerMap) Install() error

func (ComposerMap) InstallDeps

func (m ComposerMap) InstallDeps() (err error)

type CopyAction

type CopyAction struct {
	Src string `json:"src"`
	Dst string `json:"dst"`
}

CopyAction Copies a file or directory when activated

func (CopyAction) Activate

func (copy CopyAction) Activate() error

type Map

type Map map[string]*Module

func (Map) ModuleEnabled

func (modules Map) ModuleEnabled(name string) bool

func (Map) Slice

func (modules Map) Slice() Slice

func (Map) ToDefaultSlice

func (modules Map) ToDefaultSlice() []string

func (Map) ToOptionsSlice

func (modules Map) ToOptionsSlice() []string

func (*Map) UnmarshalYAML

func (modules *Map) UnmarshalYAML(value *yaml.Node) error

func (Map) WriteAnswer

func (modules Map) WriteAnswer(name string, value any) error

type Module

type Module struct {
	Name     string         `json:"-"`
	Dev      bool           `json:"dev,omitempty"`
	Enabled  bool           `json:"enabled,omitempty"`
	Hidden   bool           `json:"hidden,omitempty"`
	Version  string         `json:"version,omitempty"`
	Priority int8           `json:"priority,omitempty"`
	Then     []ActionsUnion `json:"then,omitempty"`
}

func (*Module) WriteAnswer

func (module *Module) WriteAnswer(name string, value any) error

type NpmMap

type NpmMap struct {
	Map
}

func (NpmMap) Install

func (NpmMap) Install() error

func (NpmMap) InstallDeps

func (m NpmMap) InstallDeps() (err error)

type RunAction

type RunAction []string

RunAction Runs an action when activated

func (RunAction) Activate

func (run RunAction) Activate() error

type Slice

type Slice []*Module

func (Slice) Len

func (slice Slice) Len() int

func (Slice) Less

func (slice Slice) Less(i, j int) bool

func (Slice) Swap

func (slice Slice) Swap(i, j int)

Jump to

Keyboard shortcuts

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