upgrader

package
v0.0.0-...-7378411 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const SystemTypeVersion = "version"

Variables

This section is empty.

Functions

func RegistUpgrader

func RegistUpgrader(version string, handlerFunc func(context.Context, dal.RDB, *Config) error)

RegistUpgrader register upgrader

func Upgrade

func Upgrade(ctx context.Context, db dal.RDB, conf *Config) (err error)

Upgrade uprade the db datas to newest verison we use date instead of version later since 2018.09.04, because the version wasn't manage by the developer ps: when use date instead of version, the date should add x prefix cause x > v

func Upsert

func Upsert(ctx context.Context, db dal.RDB, tablename string, row interface{}, idfieldname string, keys []string, ignores []string) (instID uint64, preData map[string]interface{}, err error)

Upsert inset row but updata it whitout ignores key if exists same value with keys

Types

type Config

type Config struct {
	OwnerID      string
	SupplierID   int
	User         string
	CCApiSrvAddr string // cmdb nginx address
}

Config config for upgrader

type System

type System struct {
	Type string `bson:"type"`
}

type Upgrader

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

Upgrader define a version upgrader

type Version

type Version struct {
	System            `bson:",inline"`
	CurrentVersion    string `bson:"current_version"`
	Distro            string `bson:"distro"`
	DistroVersion     string `bson:"distro_version"`
	InitVersion       string `bson:"init_version"`
	InitDistroVersion string `bson:"init_distro_version"`
}

Directories

Path Synopsis
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Tencent is pleased to support the open source community by making 蓝鲸 available.

Jump to

Keyboard shortcuts

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