migration

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: Apache-2.0 Imports: 14 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) Remove

func (m *Migration) Remove(namespace string, migrationLog *dbclient.MigrationLog) (err error)

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

Jump to

Keyboard shortcuts

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