models

package
v0.0.0-...-a00c48f Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: MIT, GPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DB *mysql.DB

Functions

This section is empty.

Types

type Area

type Area struct {
}

func (*Area) CountAreas

func (area *Area) CountAreas() (count int, err error)

func (*Area) CountAreasByID

func (area *Area) CountAreasByID(column, id string) (count int, err error)

func (*Area) Delete

func (p *Area) Delete(areaId string) (err error)

func (*Area) GetAreaByAreaId

func (p *Area) GetAreaByAreaId(areaId string) (area map[string]string, err error)

func (*Area) GetAreasByIDAndLimit

func (area *Area) GetAreasByIDAndLimit(column, id string, limit int, number int) (areas []map[string]string, err error)

根据搜索分页获取Area

func (*Area) GetAreasByLimit

func (area *Area) GetAreasByLimit(limit int, number int) (areas []map[string]string, err error)

分页获取Area

func (*Area) Insert

func (p *Area) Insert(area map[string]interface{}) (id int64, err error)

func (*Area) Update

func (p *Area) Update(areaId string, area map[string]interface{}) (id int64, err error)

type Client

type Client struct {
}

func (*Client) CountClients

func (client *Client) CountClients() (count int, err error)

func (*Client) CountClientsByUserID

func (client *Client) CountClientsByUserID(userID string) (count int, err error)

func (*Client) Delete

func (p *Client) Delete(clientId string) (err error)

func (*Client) GetAllClients

func (this *Client) GetAllClients() (clients []map[string]string, err error)

获取所有的Client

func (*Client) GetClientByClientId

func (p *Client) GetClientByClientId(clientId string) (client map[string]string, err error)

func (*Client) GetClientsByLimit

func (client *Client) GetClientsByLimit(limit int, number int) (clients []map[string]string, err error)

分页获取Client

func (*Client) GetClientsByUserIDAndLimit

func (client *Client) GetClientsByUserIDAndLimit(userID string, limit int, number int) (clients []map[string]string, err error)

根据user_id分页获取Client

func (*Client) HasTunnelRef

func (p *Client) HasTunnelRef(clientId string) (has bool, err error)

func (*Client) Insert

func (p *Client) Insert(client map[string]interface{}) (id int64, err error)

func (*Client) Offline

func (p *Client) Offline(serverId string) (err error)

func (*Client) Reset

func (p *Client) Reset(clientId string) (err error)

func (*Client) Update

func (p *Client) Update(clientId string, client map[string]interface{}) (id int64, err error)

type Cluster

type Cluster struct {
}

func (*Cluster) Delete

func (p *Cluster) Delete(clusterId string) (err error)

func (*Cluster) Forbidden

func (p *Cluster) Forbidden(clusterId string) (err error)

禁用

func (*Cluster) GetAllClusters

func (this *Cluster) GetAllClusters() (clusters []map[string]string, err error)

获取所有的

func (*Cluster) GetClusterByClusterId

func (p *Cluster) GetClusterByClusterId(clusterId string) (cluster map[string]string, err error)

func (*Cluster) HasTunnel

func (p *Cluster) HasTunnel(clusterId string) (has bool, err error)

func (*Cluster) Insert

func (p *Cluster) Insert(cluster map[string]interface{}) (id int64, err error)

func (*Cluster) Review

func (p *Cluster) Review(clusterId string) (err error)

恢复

func (*Cluster) Update

func (p *Cluster) Update(clusterId string, cluster map[string]interface{}) (id int64, err error)

type Conn

type Conn struct {
}

func (*Conn) CountConns

func (conn *Conn) CountConns() (count int, err error)

func (*Conn) CountConnsByUserID

func (conn *Conn) CountConnsByUserID(col, keyword string) (count int, err error)

func (*Conn) Delete

func (p *Conn) Delete(connId string) (err error)

func (*Conn) GetConnByConnId

func (p *Conn) GetConnByConnId(connId string) (conn map[string]string, err error)

func (*Conn) GetConnsByLimit

func (conn *Conn) GetConnsByLimit(limit int, number int, orderby string) (conns []map[string]string, err error)

分页获取Conn

func (*Conn) GetConnsByUserIDAndLimit

func (conn *Conn) GetConnsByUserIDAndLimit(col, keyword, orderby string, limit int, number int) (conns []map[string]string, err error)

根据user_id分页获取Conn

func (*Conn) HasTunnelRef

func (p *Conn) HasTunnelRef(connId string) (has bool, err error)

func (*Conn) Insert

func (p *Conn) Insert(conn map[string]interface{}) (id int64, err error)

func (*Conn) Offline

func (p *Conn) Offline(connId string) (err error)

func (*Conn) Reset

func (p *Conn) Reset(connId string) (err error)

func (*Conn) Update

func (p *Conn) Update(connId string, conn map[string]interface{}) (id int64, err error)

type IpList

type IpList struct {
}

func (*IpList) CountIpLists

func (ip_list *IpList) CountIpLists() (count int, err error)

func (*IpList) CountIpListsByID

func (ip_list *IpList) CountIpListsByID(column, id string) (count int, err error)

func (*IpList) Delete

func (p *IpList) Delete(ip_listId string) (err error)

func (*IpList) GetIpListByIpListId

func (p *IpList) GetIpListByIpListId(ip_listId string) (ip_list map[string]string, err error)

func (*IpList) GetIpListsByIDAndLimit

func (ip_list *IpList) GetIpListsByIDAndLimit(column, id string, limit int, number int) (ip_lists []map[string]string, err error)

根据搜索分页获取IpList

func (*IpList) GetIpListsByLimit

func (ip_list *IpList) GetIpListsByLimit(limit int, number int) (ip_lists []map[string]string, err error)

分页获取IpList

func (*IpList) Insert

func (p *IpList) Insert(ip_list map[string]interface{}) (id int64, err error)

func (*IpList) Update

func (p *IpList) Update(ip_listId string, ip_list map[string]interface{}) (id int64, err error)

type Online

type Online struct {
}

func (*Online) CountOnlines

func (online *Online) CountOnlines(cs string) (count int, err error)

func (*Online) CountOnlinesByID

func (online *Online) CountOnlinesByID(cs, column, id string) (count int, err error)

func (*Online) Delete

func (p *Online) Delete(onlineId string) (err error)

func (*Online) GetOnlineByOnlineId

func (p *Online) GetOnlineByOnlineId(onlineId string) (online map[string]string, err error)

func (*Online) GetOnlinesByIDAndLimit

func (online *Online) GetOnlinesByIDAndLimit(cs, column, id string, limit int, number int) (onlines []map[string]string, err error)

根据搜索分页获取Online

func (*Online) GetOnlinesByLimit

func (online *Online) GetOnlinesByLimit(cs string, limit int, number int) (onlines []map[string]string, err error)

分页获取Online

func (*Online) Insert

func (p *Online) Insert(online map[string]interface{}) (id int64, err error)

func (*Online) Update

func (p *Online) Update(onlineId string, online map[string]interface{}) (id int64, err error)

type PackageModel

type PackageModel struct {
}

func (*PackageModel) CountPackages

func (p *PackageModel) CountPackages() (count int, err error)

func (*PackageModel) CountPackagesByID

func (p *PackageModel) CountPackagesByID(column, id string) (count int, err error)

func (*PackageModel) Delete

func (p *PackageModel) Delete(packageId string) (err error)

func (*PackageModel) GetPackageByPackageId

func (p *PackageModel) GetPackageByPackageId(packageId string) (PackageModel map[string]string, err error)

func (*PackageModel) GetPackagesByIDAndLimit

func (p *PackageModel) GetPackagesByIDAndLimit(column, id string, limit int, number int) (packages []map[string]string, err error)

根据搜索分页获取Package

func (*PackageModel) GetPackagesByLimit

func (p *PackageModel) GetPackagesByLimit(limit int, number int) (packages []map[string]string, err error)

分页获取Package

func (*PackageModel) Insert

func (p *PackageModel) Insert(_package map[string]interface{}) (id int64, err error)

func (*PackageModel) Update

func (p *PackageModel) Update(packageId string, _package map[string]interface{}) (id int64, err error)

type Region

type Region struct {
}

func (*Region) Delete

func (p *Region) Delete(regionId string) (err error)

func (*Region) GetAllRegions

func (this *Region) GetAllRegions() (regions []map[string]string, err error)

获取所有的Region

func (*Region) GetRegionByRegionId

func (p *Region) GetRegionByRegionId(regionId string) (region map[string]string, err error)

func (*Region) GetSubRegions

func (this *Region) GetSubRegions() (regions []map[string]string, err error)

获取所有二级Region

func (*Region) GetTopRegions

func (this *Region) GetTopRegions() (regions map[string]map[string]string, err error)

获取所有顶级Region

func (*Region) HasCluster

func (p *Region) HasCluster(regionId string) (has bool, err error)

func (*Region) HasRole

func (p *Region) HasRole(regionId string) (has bool, err error)

func (*Region) HasSubRegion

func (p *Region) HasSubRegion(regionId string) (has bool, err error)

func (*Region) Insert

func (p *Region) Insert(region map[string]interface{}) (id int64, err error)

func (*Region) Update

func (p *Region) Update(regionId string, region map[string]interface{}) (id int64, err error)

type Role

type Role struct {
}

func (*Role) Delete

func (p *Role) Delete(roleId string) (err error)

func (*Role) GetAllRoles

func (this *Role) GetAllRoles() (roles []map[string]string, err error)

获取所有的角色

func (*Role) GetRoleByRoleId

func (p *Role) GetRoleByRoleId(roleId string) (role map[string]string, err error)

func (*Role) GetRoleRegionIds

func (this *Role) GetRoleRegionIds(roleId string) (ids []string, err error)

func (*Role) GetRolesByUserId

func (this *Role) GetRolesByUserId(userId string) (roles []map[string]string, err error)

根据用户名查找所有的角色

func (*Role) HasUser

func (p *Role) HasUser(roleId string) (has bool, err error)

func (*Role) Insert

func (p *Role) Insert(role map[string]interface{}) (id int64, err error)

func (*Role) SetRegions

func (this *Role) SetRegions(roleId string, region_ids []string) (err error)

func (*Role) Update

func (p *Role) Update(roleId string, role map[string]interface{}) (id int64, err error)

type Server

type Server struct {
}

func (*Server) CountServers

func (server *Server) CountServers() (count int, err error)

func (*Server) CountServersByUserID

func (server *Server) CountServersByUserID(userID string) (count int, err error)

func (*Server) Delete

func (p *Server) Delete(serverId string) (err error)

func (*Server) GetServerByServerId

func (p *Server) GetServerByServerId(serverId string) (server map[string]string, err error)

func (*Server) GetServersByLimit

func (server *Server) GetServersByLimit(limit int, number int) (servers []map[string]string, err error)

分页获取Server

func (*Server) GetServersByUserIDAndLimit

func (server *Server) GetServersByUserIDAndLimit(userID string, limit int, number int) (servers []map[string]string, err error)

根据user_id分页获取Server

func (*Server) HasTunnelRef

func (p *Server) HasTunnelRef(serverId string) (has bool, err error)

func (*Server) Insert

func (p *Server) Insert(server map[string]interface{}) (id int64, err error)

func (*Server) Offline

func (p *Server) Offline(serverId string) (err error)

func (*Server) Reset

func (p *Server) Reset(serverId string) (err error)

func (*Server) Update

func (p *Server) Update(serverId string, server map[string]interface{}) (id int64, err error)

type Tunnel

type Tunnel struct {
}

func (*Tunnel) CountTunnels

func (tunnel *Tunnel) CountTunnels() (count int, err error)

func (*Tunnel) CountTunnelsByID

func (tunnel *Tunnel) CountTunnelsByID(column, id string) (count int, err error)

func (*Tunnel) Delete

func (p *Tunnel) Delete(tunnelId string) (err error)

func (*Tunnel) GetTunnelByTunnelId

func (p *Tunnel) GetTunnelByTunnelId(tunnelId string) (tunnel map[string]string, err error)

func (*Tunnel) GetTunnelsByIDAndLimit

func (tunnel *Tunnel) GetTunnelsByIDAndLimit(column, id string, limit int, number int) (tunnels []map[string]string, err error)

根据搜索分页获取Tunnel

func (*Tunnel) GetTunnelsByLimit

func (tunnel *Tunnel) GetTunnelsByLimit(limit int, number int) (tunnels []map[string]string, err error)

分页获取Tunnel

func (*Tunnel) Insert

func (p *Tunnel) Insert(tunnel map[string]interface{}) (id int64, err error)

func (*Tunnel) Update

func (p *Tunnel) Update(tunnelId string, tunnel map[string]interface{}) (id int64, err error)

type User

type User struct {
}

func (*User) ChangePassword

func (p *User) ChangePassword(userId, newpassword, oldpassword string) (err error)

func (*User) CountUsers

func (user *User) CountUsers() (count int, err error)

func (*User) CountUsersByKeyword

func (user *User) CountUsersByKeyword(keyword string) (count int, err error)

func (*User) EncodePassword

func (p *User) EncodePassword(password string) (passwordHash string)

func (*User) Forbidden

func (p *User) Forbidden(userId string) (err error)

禁用

func (*User) GetUserByName

func (p *User) GetUserByName(username string) (user map[string]string, err error)

func (*User) GetUserByUserId

func (p *User) GetUserByUserId(userId string) (user map[string]string, err error)

func (*User) GetUsersByKeywordAndLimit

func (user *User) GetUsersByKeywordAndLimit(keyword string, limit int, number int) (users []map[string]string, err error)

根据关键字分页获取用户

func (*User) GetUsersByLimit

func (user *User) GetUsersByLimit(limit int, number int) (users []map[string]string, err error)

分页获取用户

func (*User) HasSameUsername

func (p *User) HasSameUsername(userId, username string) (has bool, err error)

func (*User) HasUsername

func (p *User) HasUsername(username string) (has bool, err error)

func (*User) Insert

func (p *User) Insert(user map[string]interface{}) (id int64, err error)

func (*User) Review

func (p *User) Review(userId string) (err error)

恢复

func (*User) Update

func (p *User) Update(userId string, user map[string]interface{}) (id int64, err error)

type UserRole

type UserRole struct {
	UserRoleID uint   `orm:"pk"` // user_role_id
	UserID     uint64 // user_id
	RoleID     uint   // role_id
	CreateTime uint   // create_time
	UpdateTime uint   // update_time
}

func (*UserRole) GetUserRolesByUserId

func (this *UserRole) GetUserRolesByUserId(userId string) (userRoles []map[string]string, err error)

func (*UserRole) Insert

func (this *UserRole) Insert(userId string, roleIds []string) (res bool, err error)

插入 user_id 和 role_id 对应关系

Jump to

Keyboard shortcuts

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