worker

package
v0.0.0-...-f8c6ab4 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	None   Action = 0
	Update Action = 1
	Delete Action = 2
	Insert Action = 3
	Select Action = 4
	Alter  Action = 5
	Create Action = 6
)

func Of

func Of(action string) Action

func (Action) String

func (self Action) String() string

type ChangeValue

type ChangeValue struct {
	Index  int         `json:"index"`
	Column string      `json:"column"`
	Value  interface{} `json:"value"`
	Before interface{} `json:"before"`
	After  interface{} `json:"after"`
}

type DataEvent

type DataEvent struct {
	Action  string          `json:"action"`
	Table   string          `json:"table"`
	Columns []schema.Column `json:"columns"`
}

type DeleteEvent

type DeleteEvent struct {
	DataEvent
	Rows [][]ChangeValue `json:"rows"`
}

type DeleteMapping

type DeleteMapping struct {
}

type EventListener

type EventListener interface {
	// contains filtered or unexported methods
}

type InsertEvent

type InsertEvent struct {
	DataEvent
	Rows [][]ChangeValue `json:"rows"`
}

type InsertMapping

type InsertMapping struct {
}

type Mapping

type Mapping interface {
	// contains filtered or unexported methods
}

type OEvent

type OEvent struct {
	Action  Action
	Table   string
	Rows    [][]interface{}
	Columns []schema.Column
}

type Position

type Position struct {
	Name       string
	Pos        uint64
	Force      bool
	UpdateTime time.Time
}

func NewPosition

func NewPosition(name string, pos uint64, force bool) *Position

func NewPositionWithForce

func NewPositionWithForce(name string, pos uint64) *Position

type Schema

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

type Store

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

type Task

type Task struct {
	Status TaskStatus
	// contains filtered or unexported fields
}

func NewTask

func NewTask(id string, t *cfg.CfgTask, r registry.Registry) *Task

func (*Task) Initialize

func (t *Task) Initialize()

func (*Task) Run

func (t *Task) Run()

func (*Task) StartUp

func (t *Task) StartUp() error

func (*Task) Stop

func (t *Task) Stop()

type TaskStatus

type TaskStatus int32
const (
	Waiting TaskStatus = 0 // 未初始化
	Running TaskStatus = 1 // 工作中
	Pending TaskStatus = 2 // 已初始化,未开始运行
)

type UpdateEvent

type UpdateEvent struct {
	DataEvent
	Rows [][]ChangeValue `json:"rows"`
}

type UpdateMapping

type UpdateMapping struct {
}

type Worker

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

func NewEmptyWorker

func NewEmptyWorker() *Worker

func NewWorkerWithCfg

func NewWorkerWithCfg(r registry.Registry) *Worker

func (*Worker) Join

func (self *Worker) Join(id string, t *Task)

func (*Worker) Refresh

func (self *Worker) Refresh()

校验任务状态 Task.Status 和 Task 之间实际的工作状态校验

func (*Worker) StartUp

func (self *Worker) StartUp()

func (*Worker) Stop

func (self *Worker) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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