application

package
v0.0.0-...-1b09624 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2020 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AppStateRunning = 1
	AppStateReload  = 2
	AppStateStop    = 3
)

Variables

This section is empty.

Functions

func Reload

func Reload() error

func Run

func Run() error

func Stop

func Stop() error

Types

type App

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

func (*App) AddHandler

func (app *App) AddHandler(name string, handler TaskHandler)

添加处理者

func (*App) Context

func (app *App) Context() *context.BaseContext

获取根上下文

func (*App) Reload

func (app *App) Reload() error

重启

func (*App) Run

func (app *App) Run() error

运行

func (*App) SetState

func (app *App) SetState(state int16)

设置状态

func (*App) Stop

func (app *App) Stop() error

停止

type MysqlHandler

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

func NewMysqlHandler

func NewMysqlHandler(ctx *context.BaseContext) *MysqlHandler

func (*MysqlHandler) Execute

func (handler *MysqlHandler) Execute() error

运行

func (*MysqlHandler) HandleDirect

func (handler *MysqlHandler) HandleDirect(ctx *context.BizContext) error

syncDirect implement

func (*MysqlHandler) HandleInspect

func (handler *MysqlHandler) HandleInspect(ctx *context.BizContext) bool

inspect implement

func (*MysqlHandler) HandleMqMessage

func (handler *MysqlHandler) HandleMqMessage(ctx *context.BizContext, msg *syncmq.TopicMessage) error

syncMq implement

func (*MysqlHandler) LoadConfig

func (handler *MysqlHandler) LoadConfig(conf config.MysqlTaskConfig) error

加载配置

type TaskHandler

type TaskHandler interface {
	Execute() error
}

任务处理接口

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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