internal

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigPath

func ConfigPath(name string) string

func ConsoleRed added in v0.1.3

func ConsoleRed(txt string) string

ConsoleRed 控制台红色字符

func Execute

func Execute(args []string)

Types

type Command added in v0.1.3

type Command struct {
	Cmd     string
	Args    []string
	Match   string // 正则表达式
	Timeout time.Duration
	Trace   bool
}

func (*Command) Exec added in v0.1.3

func (c *Command) Exec(ctx context.Context, env []string)

func (*Command) IsMatch added in v0.1.3

func (c *Command) IsMatch(str string) (bool, error)

type Config

type Config struct {
	Trace bool
	Rules []*Rule
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig(name string) (*Config, error)

func (*Config) Format added in v0.1.1

func (c *Config) Format() error

func (*Config) Rule

func (c *Config) Rule() (*Rule, error)

type Rule

type Rule struct {
	Trace bool
	Dir   []string
	Cmd   string
	Args  []string
	Env   []string

	Pre  []*Command
	Post []*Command
}

func (*Rule) Format added in v0.1.1

func (r *Rule) Format() error

func (*Rule) Match

func (r *Rule) Match(wd string) int

func (*Rule) Run

func (r *Rule) Run(args []string)

Jump to

Keyboard shortcuts

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