Documentation ¶
Index ¶
- Constants
- Variables
- func Insert(ctx context.Context, db dal.RDB, tableName string, row interface{}, ...) error
- func Int64Compare(val1, val2 int64) int
- func RegistUpgrader(version string, handlerFunc func(context.Context, dal.RDB, *Config) error)
- func RegisterUpgraderWithRedis(version string, ...)
- func StringCompare(s1, s2 string) int
- func Upgrade(ctx context.Context, db dal.RDB, cache *redis.Client, conf *Config) (currentVersion string, finishedMigrations []string, err error)
- func UpgradeConfigAdmin(ctx context.Context, db dal.RDB) error
- func Upsert(ctx context.Context, db dal.RDB, tableName string, row interface{}, ...) (instID uint64, preData map[string]interface{}, err error)
- func V36VersionCmp(version1, version2 string) int
- func ValidateMigrationVersionFormat(version string) error
- func VersionCmp(version1, version2 string) int
- type Config
- type NgVersion
- type System
- type Upgrader
- type Version
Constants ¶
const SystemTypeVersion = "version"
const VersionNgPrefix = "y"
Variables ¶
var LegacyMigrationVersion = []string{
"v3.0.8",
"v3.0.9-beta.1",
"v3.0.9-beta.3",
"v3.1.0-alpha.2",
"x08.09.04.01",
"x08.09.11.01",
"x08.09.13.01",
"x08.09.17.01",
"x08.09.18.01",
"x08.09.26.01",
"x18.09.30.01",
"x18.10.10.01",
"x18.10.30.01",
"x18.10.30.02",
"x18.11.19.01",
"x18.12.12.01",
"x18.12.12.02",
"x18.12.12.03",
"x18.12.12.04",
"x18.12.12.05",
"x18.12.12.06",
"x18.12.13.01",
"x18_12_13_02",
"x19.01.18.01",
"x19.02.15.10",
"x19.04.16.01",
"x19.04.16.02",
"x19.04.16.03",
"x19.05.16.01",
"x19_05_22_01",
"x19_08_19_01",
"x19_08_20_01",
"x19_08_26_01",
"x19_08_26_02",
"x19_09_03_01",
"x19_09_03_02",
"x19_09_03_03",
"x19_09_03_04",
"x19_09_03_05",
"x19_09_03_06",
"x19_09_03_07",
"x19_09_03_08",
"x19_09_06_01",
"x19_09_27_01",
"x19_10_09_01",
"x19_10_22_01",
}
var PatchRegex = regexp.MustCompile(`^\d{12}$`)
var ValidMigrationVersionFormat = []*regexp.Regexp{ regexp.MustCompile(`^x(\d+_){3}\d+$`), regexp.MustCompile(`^y(\d+\.){2}\d{12}$`), }
Functions ¶
func Insert ¶
func Insert(ctx context.Context, db dal.RDB, tableName string, row interface{}, idField string, uniqueKeys []string) error
Insert insert the row to db if it doesn't exist, else do nothing row is the data to insert idField used to be field name of generated instance id uniqueKeys used to judge whether the row exist in db
func Int64Compare ¶
func RegistUpgrader ¶
RegistUpgrader register upgrader
func RegisterUpgraderWithRedis ¶
func RegisterUpgraderWithRedis(version string, handlerFunc func(context.Context, dal.RDB, *redis.Client, *Config) error)
RegisterUpgraderWithRedis register upgrader with redis
func StringCompare ¶
func Upgrade ¶
func Upgrade(ctx context.Context, db dal.RDB, cache *redis.Client, conf *Config) (currentVersion string, finishedMigrations []string, err error)
Upgrade upgrade the db data to newest version 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 UpgradeConfigAdmin ¶
UpgradeConfigAdmin 升级配置管理 每次升级变更配置,需要在configChangeHistory最后追加一项要变更的配置 将configChangeHistory里的最后一项作为当前配置项curCfg,倒数第二项作为上一次配置项preCfg 需要将preCfg和db存在的配置dbCfg进行对比,对于不一致的(说明有用户调过配置管理接口做过更改),curCfg里对应的配置不做覆盖,仍为db里的数据
func Upsert ¶
func Upsert(ctx context.Context, db dal.RDB, tableName string, row interface{}, idField string, uniqueKeys []string, ignores []string) (instID uint64, preData map[string]interface{}, err error)
Upsert inset row but update it without ignores key if exists same value with keys
func V36VersionCmp ¶
func VersionCmp ¶
Types ¶
type NgVersion ¶
func ParseNgVersion ¶
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. |
* 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. |
* 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. |
* 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. |
* 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. |
* 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. |
* 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. |
* 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. |
* 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. |
* 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. |
* 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. |
* 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. |
* 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. |