Documentation ¶
Index ¶
- type Cluster
- type ElementAdmin
- type Host
- type OrderDetail
- type OrderMaster
- type OrderRenewal
- type Promotion
- type RancherServer
- type Result
- func AddCluster(cluster *Cluster) Result
- func AddHost(host *Host) Result
- func AddOrderDetail(host *OrderDetail) Result
- func AddOrderMaster(host *OrderMaster) Result
- func AddOrderRenewal(host *OrderRenewal) Result
- func AddPromotion(Promotion *Promotion) Result
- func AddRancherServer(rancherserver *RancherServer) Result
- func AddUser(User *User) Result
- func DeleteCluster(id int) Result
- func DeleteHost(id int) Result
- func DeleteOrderDetail(id int) Result
- func DeleteOrderMaster(id int) Result
- func DeleteOrderRenewal(id int) Result
- func DeletePromotion(id int) Result
- func DeleteRancherServer(id int) Result
- func DeleteUser(id int) Result
- func GetClusterList(name string, from, limit int) Result
- func GetHostList(name, ip string, from, limit int) Result
- func GetOrderDetailList(name string, from, limit int) Result
- func GetOrderMasterList(name string, from, limit int) Result
- func GetOrderRenewalList(name string, from, limit int) Result
- func GetPromotionList(name string, from, limit int) Result
- func GetRancherServerList(region string, from, limit int) Result
- func GetUserInfo(token string) Result
- func GetUserList(mobile, email string, from, limit int) Result
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct { Id int `xorm:"not null pk autoincr INT(11)"` Rid string `xorm:"comment('集群在rancher服务上的Id') VARCHAR(255)"` RancherId int `xorm:"not null comment('rancher表主键') INT(11)"` OwnerId int `xorm:"not null comment('集群所有者') INT(11)"` Name string `xorm:"comment('集群名称') VARCHAR(128)"` NetworkType string `xorm:"default '' comment('网络类型:inner:内网;outer:外网') VARCHAR(10)"` Profit float64 `xorm:"default 0 comment('收益,每次购买资源后 将订单金额累加到改字段') DOUBLE"` CpuKernel float64 `xorm:"comment('核数') DOUBLE(11,2)"` CpuKernelUsed float64 `xorm:"not null default 0.00 comment('已用核数') DOUBLE(11,2)"` CpuKernelLock float64 `xorm:"not null default 0.00 comment('订单占用cpu核数(会自动释放15分)') DOUBLE(11,2)"` Mem float64 `xorm:"comment('内存(G)') DOUBLE"` MemUsed float64 `xorm:"not null default 0 comment('已用内存') DOUBLE"` MemLock float64 `xorm:"not null default 0 comment('内存占用') DOUBLE"` Disk float64 `xorm:"comment('硬盘(G)') DOUBLE"` DiskUsed float64 `xorm:"not null default 0 comment('已用硬盘') DOUBLE"` DiskLock float64 `xorm:"not null default 0 comment('硬盘占用') DOUBLE"` Capacity string `xorm:"comment('集群的容量') TEXT"` Limits string `xorm:"comment('集群的限额') TEXT"` Requested string `xorm:"comment('集群的需求') TEXT"` Network float64 `xorm:"comment('宽带(M)') DOUBLE"` NetworkUsed float64 `xorm:"not null default 0 comment('已用宽带') DOUBLE"` NetworkLock float64 `xorm:"not null default 0 comment('宽带占用') DOUBLE"` Pods int `xorm:"default 0 comment('Pod总量') INT(11)"` PodsUsed int `xorm:"default 0 comment('已使用Pod数量') INT(11)"` State string `xorm:"default '0' comment('集群状态') VARCHAR(50)"` ClusterInfo string `xorm:"comment('同步主机的信息') TEXT"` Command string `xorm:"comment('集群中主机命令') VARCHAR(5000)"` TotalCompute float64 `xorm:"default 0 comment('算力') DOUBLE"` UsedCompute float64 `xorm:"default 0 DOUBLE"` RentPrice float64 `xorm:"comment('出租价格') DOUBLE"` Deleted int `xorm:"not null default 0 comment('是否删除') INT(11)"` Online int `xorm:"default 0 comment('是否上架') TINYINT(1)"` BeginTime time.Time `xorm:"comment('集群有效开始时间') DATETIME"` EndTime time.Time `xorm:"comment('集群有效结束时间') DATETIME"` UpdateTime time.Time `xorm:"DATETIME"` CreateTime time.Time `xorm:"DATETIME"` SyncTime time.Time `xorm:"comment('同步时间') DATETIME"` }
type ElementAdmin ¶
type Host ¶
type Host struct { Id int `xorm:"not null pk autoincr INT(11)"` Rid string `xorm:"comment('主机在rancher服务上的Id') VARCHAR(255)"` Name string `xorm:"comment('主机名称') VARCHAR(128)"` RancherId int `xorm:"INT(11)"` ClusterId int `xorm:"comment('所属集群主键') INT(11)"` OwnerId int `xorm:"not null comment('主机所有者') INT(11)"` HostIp string `xorm:"not null comment('主机IP地址') unique VARCHAR(63)"` Host string `xorm:"comment('预留,暂时未用') VARCHAR(63)"` CpuFrequency float64 `xorm:"comment('频率(GHZ)') DOUBLE(11,1)"` CpuKernel float64 `xorm:"comment('核数') DOUBLE(11)"` CpuKernelUsed float64 `xorm:"default 0 comment('已用核数') DOUBLE(11)"` CpuKernelLock float64 `xorm:"default 0 comment('订单占用cpu核数(会自动释放15分)') DOUBLE(11)"` Mem float64 `xorm:"comment('内存(G)') DOUBLE"` MemUsed float64 `xorm:"default 0 comment('已用内存') DOUBLE"` MemLock float64 `xorm:"default 0 comment('内存占用') DOUBLE"` Disk float64 `xorm:"comment('硬盘(G)') DOUBLE"` DiskUsed float64 `xorm:"default 0 comment('已用硬盘') DOUBLE"` DiskLock float64 `xorm:"default 0 comment('硬盘占用') DOUBLE"` Network float64 `xorm:"comment('宽带(M)') DOUBLE"` NetworkUsed float64 `xorm:"default 0 comment('已用宽带') DOUBLE"` NetworkLock float64 `xorm:"default 0 comment('宽带占用') DOUBLE"` Pods int `xorm:"default 0 comment('Pod总量') INT(11)"` PodsUsed int `xorm:"default 0 comment('已使用Pod数量') INT(11)"` State string `xorm:"not null default '0' comment('主机状态') VARCHAR(50)"` HostInfo string `xorm:"comment('同步主机的信息') TEXT"` Command string `xorm:"comment('生成主机的命令') VARCHAR(5000)"` TotalCompute float64 `xorm:"comment('算力') DOUBLE"` UsedCompute float64 `xorm:"comment('算力') DOUBLE"` Deleted int `xorm:"default 0 comment('是否删除') INT(11)"` BeginTime time.Time `xorm:"comment('主机有效开始时间') DATETIME"` Etcd int `xorm:"TINYINT(1)"` ControlPlane int `xorm:"TINYINT(1)"` Worker int `xorm:"TINYINT(1)"` EndTime time.Time `xorm:"comment('主机有效结束时间') DATETIME"` UpdateTime time.Time `xorm:"DATETIME"` CreateTime time.Time `xorm:"DATETIME"` SyncTime time.Time `xorm:"comment('同步时间') DATETIME"` CallbackUrl string `xorm:"comment('主机回调地址') VARCHAR(50)"` PublicAddress int `xorm:"not null default 1 TINYINT(1)"` }
type OrderDetail ¶
type OrderDetail struct { Id int `xorm:"not null pk autoincr comment('订单号') INT(11)"` OrderNo string `xorm:"not null VARCHAR(15)"` ProdId int `xorm:"not null comment('商品编号') INT(11)"` ProdType string `xorm:"not null comment('商品类型') VARCHAR(20)"` RentDays int `xorm:"not null default 0 comment('租用天数') INT(11)"` ProdAmount float64 `xorm:"default 0 comment('金额') DOUBLE"` ProdName string `xorm:"comment('商品名称') VARCHAR(128)"` ProdPrice float64 `xorm:"comment('价格') DOUBLE"` ProdInfo string `xorm:"TEXT"` Rid string `xorm:"comment('商品在rancher服务上的Id.') VARCHAR(128)"` DeployTime time.Time `xorm:"DATETIME"` BeginTime time.Time `xorm:"comment('租用开始时间') DATETIME"` EndTime time.Time `xorm:"comment('租用到期时间') DATETIME"` }
type OrderMaster ¶
type OrderMaster struct { Id int `xorm:"not null pk autoincr INT(11)"` OrderNo string `xorm:"not null comment('订单号') VARCHAR(15)"` BuyerId int `xorm:"comment('购买人') INT(11)"` BuyerAccount string `xorm:"VARCHAR(128)"` BuyerName string `xorm:"VARCHAR(100)"` SellerId int `xorm:"default 0 comment('卖家用户') INT(11)"` SellerAccount string `xorm:"VARCHAR(128)"` SellerName string `xorm:"VARCHAR(100)"` ProdType string `xorm:"not null comment('订单类型 host/app') VARCHAR(50)"` OrderAmount float64 `xorm:"not null default 0 comment('订单金额') DOUBLE"` Poundage float64 `xorm:"comment('手续费') DOUBLE"` OrderStatus int `xorm:"not null default 0 comment('状态') INT(11)"` OrderHash string `xorm:"comment('订单哈希') VARCHAR(128)"` PaySuccessTime time.Time `xorm:"comment('支付成功时间') DATETIME"` OriginalOrder string `xorm:"VARCHAR(15)"` CreateTime time.Time `xorm:"not null DATETIME"` UpdateTime time.Time `xorm:"not null DATETIME"` }
type OrderRenewal ¶
type OrderRenewal struct { Id int `xorm:"not null pk autoincr INT(11)"` RenewalNo string `xorm:"not null comment('续费单号') VARCHAR(15)"` BuyerId int `xorm:"not null comment('买家') INT(11)"` SellerId int `xorm:"not null comment('卖家') INT(11)"` OrderDetailId int `xorm:"comment('续费的订单Id') INT(11)"` OrderNo string `xorm:"not null comment('续费单号') VARCHAR(15)"` ProdId int `xorm:"not null comment('续费商品') INT(11)"` ProdType string `xorm:"not null comment('商品类型') VARCHAR(20)"` RentDays int `xorm:"not null comment('续费天数') INT(11)"` ProdAmount float64 `xorm:"comment('数量') DOUBLE"` Poundage float64 `xorm:"default 0 comment('续费单据的手续费') DOUBLE"` ProdStatus int `xorm:"comment('商品状态') INT(11)"` ProdName string `xorm:"comment('商品名称') VARCHAR(128)"` ProdPrice float64 `xorm:"comment('价格') DOUBLE"` PaySuccessTime time.Time `xorm:"comment('续费成功时间') DATETIME"` OrderHash string `xorm:"comment('订单哈希') VARCHAR(255)"` CreateTime time.Time `xorm:"DATETIME"` UpdateTime time.Time `xorm:"DATETIME"` }
type Promotion ¶
type Promotion struct { Id int `xorm:"not null pk autoincr INT(11)"` Name string `xorm:"not null comment('促销名称') VARCHAR(50)"` Content string `xorm:"comment('促销描述') TEXT"` BeginDate time.Time `xorm:"comment('开始时间') DATETIME"` EndDate time.Time `xorm:"comment('结束时间') DATETIME"` Status int `xorm:"comment('状态') INT(11)"` UpdateTime time.Time `xorm:"DATETIME"` CreateTime time.Time `xorm:"DATETIME"` }
type RancherServer ¶
type RancherServer struct { Id int `xorm:"not null pk autoincr INT(11)"` Url string `xorm:"not null VARCHAR(128)"` AccessKey string `xorm:"not null VARCHAR(128)"` SecretKey string `xorm:"not null VARCHAR(128)"` Region string `xorm:"not null VARCHAR(128)"` CreateTime time.Time `xorm:"TIMESTAMP"` UpdateTime time.Time `xorm:"TIMESTAMP"` RegionEnUs string `xorm:"VARCHAR(128)"` NetworkType string `xorm:"default '' comment('网络类型:inner:内网;outer:外网') VARCHAR(10)"` }
type Result ¶
type Result struct { Code int `json:"code"` Message string `json:"message"` Data interface{} `json:"data"` }
func AddCluster ¶
func AddOrderDetail ¶
func AddOrderDetail(host *OrderDetail) Result
func AddOrderMaster ¶
func AddOrderMaster(host *OrderMaster) Result
func AddOrderRenewal ¶
func AddOrderRenewal(host *OrderRenewal) Result
func AddPromotion ¶
func AddRancherServer ¶
func AddRancherServer(rancherserver *RancherServer) Result
func DeleteCluster ¶
func DeleteHost ¶
func DeleteOrderDetail ¶
func DeleteOrderMaster ¶
func DeleteOrderRenewal ¶
func DeletePromotion ¶
func DeleteRancherServer ¶
func DeleteUser ¶
func GetClusterList ¶
func GetHostList ¶
func GetOrderDetailList ¶
func GetOrderMasterList ¶
func GetOrderRenewalList ¶
func GetPromotionList ¶
func GetRancherServerList ¶
func GetUserInfo ¶
func GetUserList ¶
type User ¶
type User struct { Id int `xorm:"not null pk autoincr INT(11)"` AccountAddress string `xorm:"not null default '1' comment('钱包地址') VARCHAR(255)"` LoginName string `xorm:"comment('登录名') VARCHAR(50)"` Password string `xorm:"comment('密码') VARCHAR(255)"` Salt string `xorm:"comment('密码加密随即字符串') VARCHAR(10)"` RoleId int `xorm:"not null default 0 comment('用户类型(1:前台注册的用户)') INT(11)"` NickName string `xorm:"default '' comment('界面显示昵称') VARCHAR(255)"` Mobile string `xorm:"comment('手机号') VARCHAR(50)"` Email string `xorm:"comment('邮箱') VARCHAR(50)"` RegisterType string `xorm:"comment('注册类型,手机还是邮箱') VARCHAR(255)"` CaptchaMode string `xorm:"comment('验证方式,手机或邮箱') VARCHAR(255)"` CreateTime time.Time `xorm:"TIMESTAMP"` UpdateTime time.Time `xorm:"TIMESTAMP"` }
Click to show internal directories.
Click to hide internal directories.