Documentation ¶
Index ¶
- func Connect(dsn string)
- func Migrate()
- type Base
- type CloudInfo
- type ClusterInfo
- type ClusterNode
- type CodisInfo
- type GroupContain
- type MySQL
- func (m *MySQL) AddAliCloudRedis(cloud string, redisinfo model.AliRedisInstancesKVStoreInstance) (int, bool)
- func (m *MySQL) AddCfg(name, key, value string) (int, bool)
- func (m *MySQL) AddCluster(name, nodes, password string) (int, bool)
- func (m *MySQL) AddClusterNode(nodeid, ip, port, flags, masterid, linkstate, slotrange string, ...) (int, bool)
- func (m *MySQL) AddCodis(curl, cname string) (int, bool)
- func (m *MySQL) AddHistory(userid int, opinfo, opparams string) (int, bool)
- func (m *MySQL) AddTxCloudRedis(cloud string, redisinfo model.TxLResponseInstanceSet) (int, bool)
- func (m *MySQL) CreatUser(nick_name, email, password string) bool
- func (m *MySQL) DelCfg(key string) bool
- func (m *MySQL) DelCloud(instanceid string) bool
- func (m *MySQL) DelUser(userid int) bool
- func (m *MySQL) ExistCfg(key string) bool
- func (m *MySQL) ExistCloudredisId(cloud, instanceId string) bool
- func (m *MySQL) ExistUserId(id int) bool
- func (m *MySQL) ExistUserName(username string) bool
- func (m *MySQL) FindEmail(email string) bool
- func (m *MySQL) FindUser(ruser string) bool
- func (m *MySQL) FindUserPassword(ruser string) (user UserInfo, err error)
- func (m *MySQL) GetAllCfg() []Rconfig
- func (m *MySQL) GetAllCloudredis() []CloudInfo
- func (m *MySQL) GetAllCluster() []ClusterInfo
- func (m *MySQL) GetAllCodis() []CodisInfo
- func (m *MySQL) GetAllHistory() []OpHistory
- func (m *MySQL) GetAllUser() []UserInfo
- func (m *MySQL) GetCloudAddress(cloud, instanceid string) (string, string, int)
- func (m *MySQL) GetCloudNumber(cloud string) int64
- func (m *MySQL) GetCloudRegion() []CloudInfo
- func (m *MySQL) GetCloudredis(cloud, region string) []CloudInfo
- func (m *MySQL) GetClusterAddress(id string) (string, string)
- func (m *MySQL) GetClusterNode(cluster string) []ClusterNode
- func (m *MySQL) GetClusterNodeMaster(cluster string) []ClusterNode
- func (m *MySQL) GetClusterNodeMasterAddress(nodeid string) string
- func (m *MySQL) GetClusterNodeSlaverAddress(nodeid string) string
- func (m *MySQL) GetClusterNumber() int64
- func (m *MySQL) GetClusterPassword(id string) string
- func (m *MySQL) GetCodisNumber() int64
- func (m *MySQL) GetOneCfg(key string) Rconfig
- func (m *MySQL) GetOneCfgValue(key string) string
- func (m *MySQL) GetUserType(userid int) string
- func (m *MySQL) UpdateCfg(key, value string) bool
- func (m *MySQL) UpdateCloudPassword(cloud, instanceid, password string) bool
- func (m *MySQL) UpdateUserPassword(username string, password string) bool
- func (m *MySQL) UpdateUserType(username string, usertype string) bool
- func (m *MySQL) UppdateAliCloudRedis(cloud string, redisinfo model.AliRedisInstancesKVStoreInstance) bool
- func (m *MySQL) UppdateTxCloudRedis(cloud string, redisinfo model.TxLResponseInstanceSet) bool
- func (m *MySQL) UserInfo(username string) UserInfo
- type OpHistory
- type Rconfig
- type Tabler
- type UserGroup
- type UserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Base ¶
type Base struct { ID int `gorm:"primary_key"` CreatedAt time.Time `gorm:"not null"` UpdatedAt time.Time DeletedAt gorm.DeletedAt `gorm:"index"` }
base
type CloudInfo ¶
type CloudInfo struct { Base Cloud string `gorm:"type:varchar(10)"` //云厂商 InstanceId string `gorm:"not null;index;unique"` //实例ID InstanceName string `gorm:"type:varchar(100)"` //实例名称 PrivateIp string `gorm:"type:varchar(20)"` //内网IP Port int `gorm:"type:varchar(10)"` //端口 Region string `gorm:"type:varchar(20)"` //region Createtime string `gorm:"type:varchar(20)"` //创建时间 Size int `gorm:"type:varchar(10)"` //实例大小 InstanceStatus string `gorm:"type:varchar(10)"` //实例状态 RedisShardSize int `gorm:"type:varchar(10)"` //分片大小 RedisShardNum int `gorm:"type:varchar(10)"` //分练数量 RedisReplicasNum int `gorm:"type:varchar(10)"` //副本个数 NoAuth bool `gorm:"type:varchar(10)"` //是否需要密码 PublicIp string `gorm:"type:varchar(20)"` //外网IP Password string `gorm:"type:varchar(50)"` //密码 }
cloud redis信息
type ClusterInfo ¶
type ClusterInfo struct { Base Name string `gorm:"not null;index;unique"` Nodes string `gorm:"type:varchar(255)"` //ip:port,ip:port Password string `gorm:"type:varchar(255)"` }
集群信息
func (ClusterInfo) TableName ¶
func (ClusterInfo) TableName() string
type ClusterNode ¶
type ClusterNode struct { Base CluserId int `gorm:"not null;index"` //集群ID NodeId string `gorm:"type:varchar(50);unique"` //node的ID Ip string `gorm:"type:varchar(50)"` //node的IP Port string `gorm:"type:varchar(25)"` //node的端口 Flags string `gorm:"type:varchar(50)"` //node的身份 MasterId string `gorm:"type:varchar(50)"` //如果是从的话master的ID LinkState string `gorm:"type:varchar(50)"` //链接状态 RunStatus bool `gorm:"type:varchar(25)"` //运行状态 SlotRange string `gorm:"type:varchar(50)"` //slot区间 SlotNumber int `gorm:"type:varchar(25)"` //solt个数 }
node信息
func (ClusterNode) TableName ¶
func (ClusterNode) TableName() string
type CodisInfo ¶
type CodisInfo struct { Base Curl string `gorm:"not null;index;unique"` Cname string `gorm:"type:varchar(50)"` }
codis信息
type GroupContain ¶
type GroupContain struct { Base GroupId int `gorm:"not null;index"` UserId int `gorm:"not null;index"` }
组与用户的关系
func (GroupContain) TableName ¶
func (GroupContain) TableName() string
type MySQL ¶
MySQL refrence a mysql db
var DB MySQL
DB as the mysql client
func (*MySQL) AddAliCloudRedis ¶
func (*MySQL) AddCluster ¶
add cluster
func (*MySQL) AddClusterNode ¶
func (*MySQL) AddHistory ¶
add cluster
func (*MySQL) AddTxCloudRedis ¶
func (*MySQL) ExistCloudredisId ¶
func (*MySQL) ExistUserId ¶
func (*MySQL) ExistUserName ¶
func (*MySQL) FindUserPassword ¶
func (*MySQL) GetAllHistory ¶
func (*MySQL) GetAllUser ¶
func (*MySQL) GetCloudAddress ¶
func (*MySQL) GetCloudNumber ¶
func (*MySQL) GetCloudRegion ¶
func (*MySQL) GetCloudredis ¶
func (*MySQL) GetClusterNode ¶
func (m *MySQL) GetClusterNode(cluster string) []ClusterNode
func (*MySQL) GetClusterNodeMaster ¶
func (m *MySQL) GetClusterNodeMaster(cluster string) []ClusterNode
func (*MySQL) GetClusterNodeMasterAddress ¶
func (*MySQL) GetClusterNodeSlaverAddress ¶
func (*MySQL) GetClusterNumber ¶
func (*MySQL) GetClusterPassword ¶
func (*MySQL) GetCodisNumber ¶
func (*MySQL) GetUserType ¶
func (*MySQL) UpdateCloudPassword ¶
func (*MySQL) UpdateUserPassword ¶
func (*MySQL) UpdateUserType ¶
func (*MySQL) UppdateAliCloudRedis ¶
func (m *MySQL) UppdateAliCloudRedis(cloud string, redisinfo model.AliRedisInstancesKVStoreInstance) bool
ali
func (*MySQL) UppdateTxCloudRedis ¶
func (m *MySQL) UppdateTxCloudRedis(cloud string, redisinfo model.TxLResponseInstanceSet) bool
tx
type OpHistory ¶
type OpHistory struct { Base UserId int `gorm:"not null;index"` OpInfo string `gorm:"type:varchar(100)"` // 操作动作 OpParams string `gorm:"type:text"` //操作参数属组或者对象 }
操作历史
type Rconfig ¶
type Rconfig struct { Base Name string `gorm:"type:varchar(255)"` Key string `gorm:"not null:index:primary_key;unique"` Value string `gorm:"type:varchar(255)"` }
config信息
type UserGroup ¶
type UserGroup struct { Base GroupName string `gorm:"not null;index;unique"` GroupDescribe string `gorm:"type:varchar(255)"` GroupType string `gorm:"not null;index;type:varchar(50)"` //admin 管理组;visitor 访客组;staff 员工组 }
用户组
Click to show internal directories.
Click to hide internal directories.