executor

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecMulSerProgram

func ExecMulSerProgram(ex MulServicesProgram)

ExecMulSerProgram 执行多服务程序

Types

type CtrlC

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

CtrlC 捕获ctrl-c的控制器

func NewCtrlC

func NewCtrlC() *CtrlC

NewCtrlC 初始化生成CtrlC

func (*CtrlC) Run

func (c *CtrlC) Run()

Run 开始运行程序,遇到os.Interrupt停止

func (*CtrlC) SetMulServices

func (c *CtrlC) SetMulServices(m MulServices) *CtrlC

SetMulServices 设置注册多服务的方法

func (*CtrlC) SetStarter

func (c *CtrlC) SetStarter(s Starter) *CtrlC

SetStarter 设置开始方法

func (*CtrlC) SetStopper

func (c *CtrlC) SetStopper(s Stopper) *CtrlC

SetStopper 设置结束方法

type LierCmd

type LierCmd struct {
	AppName   string
	CmdName   string
	Version   string
	BuildTime string
	RunTime   string
	Desc      string
	Author    string
	// contains filtered or unexported fields
}

func NewCmd

func NewCmd(appName, cmdName, desc, version, buildTime, runTime, author string) *LierCmd

func (*LierCmd) ServicesRegistration

func (cmd *LierCmd) ServicesRegistration() []Service

ServicesRegistration 服务注册

func (*LierCmd) SetService

func (cmd *LierCmd) SetService(service ...Service)

func (*LierCmd) Start

func (cmd *LierCmd) Start() error

Start 启动

func (*LierCmd) Stop

func (cmd *LierCmd) Stop()

Stop 停止

type MulServices

type MulServices interface {
	ServicesRegistration() []Service
}

MulServices 多服务程序的注册

type MulServicesProgram

type MulServicesProgram interface {
	Starter
	Stopper
	MulServices
}

MulServicesProgram 支持多服务启动及关闭的程序接口

type Program

type Program interface {
	Starter
	Stopper
}

Program 完整程序的接口

type Service

type Service interface {
	Starter
	Stopper
}

Service 完整的服务接口

type Starter

type Starter interface {
	Start() error
}

Starter 开始方法的接口

type Stopper

type Stopper interface {
	Stop()
}

Stopper 结束方法的接口

Directories

Path Synopsis
web

Jump to

Keyboard shortcuts

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