decls

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToStringModeList int8 = iota
	ToStringModeRun
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Decl

type Decl struct {
	Name     string         `toml:"name"`
	Preset   string         `toml:"preset"`
	Priority Priority       `toml:"priority"`
	RunDat   map[string]any `toml:"rundat"` // HACK: It works, but requires addtional safety checks manually
}

Decl is the info for a single declaration

func (Decl) List

func (decl Decl) List(w io.Writer, mode int8, prestr string) error

func (*Decl) Load

func (decl *Decl) Load(path string) error

func (Decl) Run

func (decl Decl) Run(opts cmdtype.CmdRunOptions) error

type Decls

type Decls []Decl

Decls is a slice of Decl, just for []Decl to be receiver type

func GetDecls

func GetDecls(ddir string) (Decls, error)

func (Decls) List

func (decls Decls) List(w io.Writer, opts DeclsListOpts) error

func (Decls) Run

func (decls Decls) Run(opts DeclsRunOpts) error

RunDecls runs the decls by their priority, from high to low. priority filters out other priorities, use nil for no filter

type DeclsListOpts

type DeclsListOpts struct {
	Indent   int
	Priority *Priority
}

type DeclsRunOpts

type DeclsRunOpts struct {
	Cmdopts  cmdtype.CmdRunOptions
	DoPrint  bool
	Indent   uint
	Priority *Priority
}

type Priority

type Priority = uint

Jump to

Keyboard shortcuts

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