migrate

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Copyright 2019-2020 Axetroy. All rights reserved. MIT license.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Customer

type Customer struct {
}

func (Customer) Do

func (c Customer) Do() error

func (Customer) GetModel

func (c Customer) GetModel() interface{}

func (Customer) GetTableName

func (c Customer) GetTableName() string

func (Customer) GetTimeInterval

func (c Customer) GetTimeInterval(_ time.Time) time.Duration

func (Customer) Next

func (c Customer) Next(nows ...time.Time) (shouldGoNext bool, err error)

type LoginLog

type LoginLog struct {
}

func (LoginLog) Do

func (c LoginLog) Do() error

func (LoginLog) GetModel

func (c LoginLog) GetModel() interface{}

func (LoginLog) GetTableName

func (c LoginLog) GetTableName() string

func (LoginLog) GetTimeInterval

func (c LoginLog) GetTimeInterval(_ time.Time) time.Duration

func (LoginLog) Next

func (c LoginLog) Next(nows ...time.Time) (shouldGoNext bool, err error)

type Migrate

type Migrate interface {
	GetTableName() string                                  // 获取表名
	GetModel() interface{}                                 // 获取表名
	GetTimeInterval(now time.Time) time.Duration           // 时间间隔
	Next(nows ...time.Time) (shouldGoNext bool, err error) // 开始迁移, 可选的时间 nows 只是方便测试, 如果不传则使用 time.Now()
	Do() error                                             // 开始迁移,不断调用 Next()
}
var CustomerMigrate Migrate
var LoginLogMigrate Migrate

Jump to

Keyboard shortcuts

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