models

package
v0.0.0-...-7bb93db Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TiDBInited         TiDBStatus = "Inited"
	TiDBRunning                   = "Running"
	TiDBStoped                    = "Stoped"
	TiDBUpgrading                 = "Upgrading"
	TiDBWaitingUpgrade            = "WaitingUpgrade"
)

Variables

This section is empty.

Functions

func CreateTiDBCluster

func CreateTiDBCluster(tc *TiDBCluster) error

func GetTiDBCluster

func GetTiDBCluster(tc *TiDBCluster) (bool, error)

func NewEngine

func NewEngine() (err error)

NewEngine initializes a new xorm.Engine

func SetEngine

func SetEngine() (err error)

SetEngine sets the xorm.Engine

func UpdateTiDBCluster

func UpdateTiDBCluster(tc *TiDBCluster) error

Types

type Engine

type Engine interface {
	Table(tableNameOrBean interface{}) *xorm.Session
	Count(...interface{}) (int64, error)
	Decr(column string, arg ...interface{}) *xorm.Session
	Delete(interface{}) (int64, error)
	Exec(...interface{}) (sql.Result, error)
	Find(interface{}, ...interface{}) error
	Get(interface{}) (bool, error)
	ID(interface{}) *xorm.Session
	In(string, ...interface{}) *xorm.Session
	Incr(column string, arg ...interface{}) *xorm.Session
	Insert(...interface{}) (int64, error)
	InsertOne(interface{}) (int64, error)
	Iterate(interface{}, xorm.IterFunc) error
	Join(joinOperator string, tablename interface{}, condition string, args ...interface{}) *xorm.Session
	SQL(interface{}, ...interface{}) *xorm.Session
	Where(interface{}, ...interface{}) *xorm.Session
	Asc(colNames ...string) *xorm.Session
}

Engine represents a xorm engine or session.

type TiDBCluster

type TiDBCluster struct {
	ID          int64     `json:"id" xorm:"pk autoincr"`
	Name        string    `json:"name" xorm:"VARCHAR(200) UNIQUE NOT NULL"`
	Version     string    `json:"version" xorm:"VARCHAR(200)"`
	Path        string    `json:"path" xorm:"VARCHAR(200)"`
	Host        string    `json:"host" xorm:"VARCHAR(200)"`
	Status      string    `json:"status" xorm:"VARCHAR(200)"`
	Description string    `json:"description" xorm:"VARCHAR(512)"`
	InitTime    time.Time `json:"init_time" xorm:"init_time"`
}

func GetTiDBClusterByHost

func GetTiDBClusterByHost(host string) ([]*TiDBCluster, error)

func GetTiDBClusterByName

func GetTiDBClusterByName(name string) (*TiDBCluster, error)

func LoadTiDBClusters

func LoadTiDBClusters() ([]*TiDBCluster, error)

func SearchTiDBClusters

func SearchTiDBClusters(s map[string]interface{}) ([]*TiDBCluster, error)

type TiDBStatus

type TiDBStatus string

func JudgeTiDBStatusType

func JudgeTiDBStatusType(this string) (TiDBStatus, error)

Jump to

Keyboard shortcuts

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