scheduler

package
v0.0.0-...-99221f3 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

type Scheduler[T migrator.Entity] struct {
	// contains filtered or unexported fields
}

Scheduler 用来统一管理整个迁移过程 它不是必须的,你可以理解为这是为了方便用户操作(和你理解)而引入的。

func NewScheduler

func NewScheduler[T migrator.Entity](
	l logger.LoggerV1,
	src *gorm.DB,
	dst *gorm.DB,
	pool *connpool.DoubleWritePool,
	producer events.Producer) *Scheduler[T]

func (*Scheduler[T]) DstFirst

func (s *Scheduler[T]) DstFirst(c *gin.Context) (ginx.Result, error)

func (*Scheduler[T]) DstOnly

func (s *Scheduler[T]) DstOnly(c *gin.Context) (ginx.Result, error)

func (*Scheduler[T]) RegisterRoutes

func (s *Scheduler[T]) RegisterRoutes(server *gin.RouterGroup)

func (*Scheduler[T]) SrcFirst

func (s *Scheduler[T]) SrcFirst(c *gin.Context) (ginx.Result, error)

func (*Scheduler[T]) SrcOnly

func (s *Scheduler[T]) SrcOnly(c *gin.Context) (ginx.Result, error)

SrcOnly 只读写源表

func (*Scheduler[T]) StartFullValidation

func (s *Scheduler[T]) StartFullValidation(c *gin.Context) (ginx.Result, error)

StartFullValidation 全量校验

func (*Scheduler[T]) StartIncrementValidation

func (s *Scheduler[T]) StartIncrementValidation(c *gin.Context,
	req StartIncrRequest) (ginx.Result, error)

func (*Scheduler[T]) StopFullValidation

func (s *Scheduler[T]) StopFullValidation(c *gin.Context) (ginx.Result, error)

func (*Scheduler[T]) StopIncrementValidation

func (s *Scheduler[T]) StopIncrementValidation(c *gin.Context) (ginx.Result, error)

type StartIncrRequest

type StartIncrRequest struct {
	Utime int64 `json:"utime"`
	// 毫秒数
	// json 不能正确处理 time.Duration 类型
	Interval int64 `json:"interval"`
}

Jump to

Keyboard shortcuts

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