runner

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: MIT 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

func ParseID(u string) (uint32, error)

func UToID

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

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

type OrderCommand struct {
	Order int
	Names []string

	StoreReg *StoreReg
	// contains filtered or unexported fields
}

func (*OrderCommand) Run

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

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

func (*StoreReg) SetAsGlobal

func (s *StoreReg) SetAsGlobal() *StoreReg

type User

type User struct {
	UID uint32
	GID uint32
}

func UserParser

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