executor

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: MIT Imports: 5 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(ex MulServicesProgram) *CtrlC

NewCtrlC 初始化生成CtrlC

func (*CtrlC) Run

func (c *CtrlC) Run()

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

type LierCmd

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

func (*LierCmd) AddService added in v1.2.0

func (cmd *LierCmd) AddService(service Service) *LierCmd

AddService 添加一个服务

func (*LierCmd) ServicesRegistration

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

ServicesRegistration 服务注册

func (*LierCmd) Start

func (cmd *LierCmd) Start() error

Start 启动

func (*LierCmd) Stop

func (cmd *LierCmd) Stop()

Stop 停止

type LierCmdOption added in v1.1.5

type LierCmdOption func(*LierCmd)

func WithProperty added in v1.1.5

func WithProperty(property map[string]string) LierCmdOption

WithProperty 设置属性

func WithServiceName added in v1.2.0

func WithServiceName(serviceName string) LierCmdOption

WithServiceName 设置服务名称

func WithServices added in v1.1.0

func WithServices(services ...Service) LierCmdOption

WithServices 设置服务

func WithSkin added in v1.2.0

func WithSkin(skin string) LierCmdOption

WithSkin 设置皮肤

type MulServices

type MulServices interface {
	ServicesRegistration() []Service
}

MulServices 多服务程序的注册

type MulServicesProgram

type MulServicesProgram interface {
	Service
	MulServices
}

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

func NewLierCmd added in v1.0.2

func NewLierCmd(options ...LierCmdOption) MulServicesProgram

NewLierCmd 初始化生成LierCmd

type Service

type Service interface {
	Starter
	Stopper
}

Service 完整的服务接口

type Starter

type Starter interface {
	Start() error
}

Starter 开始方法的接口

type Stopper

type Stopper interface {
	Stop()
}

Stopper 结束方法的接口

Jump to

Keyboard shortcuts

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