runner

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRunInit = fmt.Errorf("run init error")

Functions

func ParseID added in v0.4.3

func ParseID(u string) (uint32, error)

func UToID added in v0.4.3

func UToID(u string, group bool) (uint32, error)

Types

type Command

type Command struct {
	Name         string
	Path         string
	Env          []string
	Filter       func([]byte) bool
	Command      []string
	AllowFailure bool
	Order        int
	Depends      []string

	User string
	// contains filtered or unexported fields
}

func (*Command) DependecyTrigger added in v0.4.2

func (c *Command) DependecyTrigger(ctx context.Context, name string) error

func (*Command) Kill

func (c *Command) Kill()

Kill the kill command.

func (*Command) Restart

func (c *Command) Restart(ctx context.Context) error

Restart is kill command after that run again that command.

func (*Command) Run

func (c *Command) Run(ctx context.Context) error

type OrderCommand added in v0.4.2

type OrderCommand struct {
	Order int
	Names []string

	StoreReg *StoreReg
	// contains filtered or unexported fields
}

func (*OrderCommand) Run added in v0.4.2

func (o *OrderCommand) Run(ctxParent context.Context, wg *sync.WaitGroup) error

type StoreReg

type StoreReg struct {
	// contains filtered or unexported fields
}

StoreReg hold commands.

var GlobalReg *StoreReg

GlobalReg using in server requests. Don't forget to run KillAll before exit the program.

func NewStoreReg

func NewStoreReg(wg *sync.WaitGroup) *StoreReg

func (*StoreReg) Add

func (s *StoreReg) Add(command *Command) error

func (*StoreReg) Del

func (s *StoreReg) Del(name string) *StoreReg

func (*StoreReg) Get

func (s *StoreReg) Get(name string) *Command

func (*StoreReg) KillAll

func (s *StoreReg) KillAll()

func (*StoreReg) Run added in v0.4.2

func (s *StoreReg) Run(ctx context.Context) error

func (*StoreReg) SetAsGlobal

func (s *StoreReg) SetAsGlobal() *StoreReg

type User added in v0.4.3

type User struct {
	UID uint32
	GID uint32
}

func UserParser added in v0.4.3

func UserParser(u string) (User, error)

UserParser parse user string to uid and gid.

Jump to

Keyboard shortcuts

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