directive

package
v0.0.0-...-bb77216 Latest Latest
Warning

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

Go to latest
Published: May 31, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Define the directive keyword globally
	Keyword = "#aa:"

	// Build the profiles with the following directive applied
	Directives = map[string]Directive{}
)

Functions

func RegisterDirective

func RegisterDirective(d Directive)

func Run

func Run(file *paths.Path, profile string) (string, error)

Types

type Dbus

type Dbus struct {
	cfg.Base
}

func (Dbus) Apply

func (d Dbus) Apply(opt *Option, profile string) (string, error)

type Directive

type Directive interface {
	cfg.BaseInterface
	Apply(opt *Option, profile string) (string, error)
}

Main directive interface

type Exec

type Exec struct {
	cfg.Base
}

func (Exec) Apply

func (d Exec) Apply(opt *Option, profileRaw string) (string, error)

type FilterExclude

type FilterExclude struct {
	cfg.Base
}

func (FilterExclude) Apply

func (d FilterExclude) Apply(opt *Option, profile string) (string, error)

type FilterOnly

type FilterOnly struct {
	cfg.Base
}

func (FilterOnly) Apply

func (d FilterOnly) Apply(opt *Option, profile string) (string, error)

type Option

type Option struct {
	Name    string
	ArgMap  map[string]string
	ArgList []string
	File    *paths.Path
	Raw     string
}

Directive options

func NewOption

func NewOption(file *paths.Path, match []string) *Option

func (*Option) Clean

func (o *Option) Clean(profile string) string

Clean the selected directive from profile. Useful to remove directive text applied on some condition only

type Stack

type Stack struct {
	cfg.Base
}

func (Stack) Apply

func (s Stack) Apply(opt *Option, profile string) (string, error)

Jump to

Keyboard shortcuts

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