g2cmd

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BuildInfoInstance = make(g2util.Map)

BuildInfoInstance ...

Functions

func BuildInfoInstanceAdd

func BuildInfoInstanceAdd(info g2util.Map)

BuildInfoInstanceAdd ...

func FindPidSliceByProcessName

func FindPidSliceByProcessName(name string) []string

FindPidSliceByProcessName get pid list

func FlagsGetBoolFunc

func FlagsGetBoolFunc(cmd *cobra.Command, name string, fn func())

FlagsGetBoolFunc ...

func KillProcess

func KillProcess(name string) (err error)

KillProcess ...kill process

func ProcessIsRunning

func ProcessIsRunning(name string) bool

ProcessIsRunning is running

Types

type G2cmd

type G2cmd struct {
	Logger j2rpc.LevelLogger `inject:""`

	Config *g2config.Config `inject:""`

	AbFile *g2abio.AbFile `inject:""`
	// contains filtered or unexported fields
}

G2cmd ...

func (*G2cmd) CmdMap

func (g *G2cmd) CmdMap() map[string]Process

CmdMap ...

func (*G2cmd) Constructor

func (g *G2cmd) Constructor()

func (*G2cmd) Execute

func (g *G2cmd) Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func (*G2cmd) RegisterCmd

func (g *G2cmd) RegisterCmd(cmd Process)

RegisterCmd ...注册cmd

func (*G2cmd) StartProcess

func (g *G2cmd) StartProcess() *startCmd

StartProcess ...

type ItfExec

type ItfExec interface {
	Start() error
	Run() error
	Output() ([]byte, error)
	CombinedOutput() ([]byte, error)
}

ItfExec ...

func NewExecInner

func NewExecInner(s string, out io.Writer) ItfExec

NewExecInner ...

func StdExec

func StdExec(s string) ItfExec

StdExec ...

type Process

type Process interface {
	Cmd() *cobra.Command
	SetFlags(cmd *cobra.Command)
	Run(cmd *cobra.Command, args []string)
}

Process ...

Jump to

Keyboard shortcuts

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