migration

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 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 Migration

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

Migration migration 实例对象封装

func New

func New(options ...Option) *Migration

New 新建 Migration service

func (*Migration) CleanUnusedMigrationNs

func (m *Migration) CleanUnusedMigrationNs() (bool, error)

func (*Migration) Create

func (m *Migration) Create(migrationLog *dbclient.MigrationLog, diceyml *diceyml.DiceYaml, Runtime *dbclient.Runtime, App *apistructs.ApplicationDTO) (data interface{}, err error)

func (*Migration) Exist

func (m *Migration) Exist(migrationLog *dbclient.MigrationLog) (created, started bool, err error)

Exist 返回 job 存在情况 created: 调用 create 成功,job 在 etcd 中已创建 started: 调用 start 成功,job 在 cluster 中已存在并开始执行

func (*Migration) Start

func (m *Migration) Start(migrationLog *dbclient.MigrationLog, diceyml *diceyml.DiceYaml, Runtime *dbclient.Runtime, App *apistructs.ApplicationDTO) (err error)

func (*Migration) Status

func (m *Migration) Status(migrationLog *dbclient.MigrationLog) (desc apistructs.MigrationStatusDesc, err error)

Status 获取migration status信息

type Option

type Option func(*Migration)

Option Migration 实例对象配置选项

func WithBundle

func WithBundle(bdl *bundle.Bundle) Option

WithBundle 配置 bundle

func WithDBClient

func WithDBClient(db *dbclient.DBClient) Option

WithDBClient 配置 db client

func WithJob

func WithJob(job job.Job) Option

WithJob 配置 job

Jump to

Keyboard shortcuts

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