Documentation ¶
Index ¶
- Constants
- Variables
- func CreateCluster(cluster *models.BcsCluster) error
- func CreateRegisterToken(clusterId string) error
- func CreateRole(role *models.BcsRole) error
- func CreateUser(user *models.BcsUser) error
- func CreateUserResourceRole(urr *models.BcsUserResourceRole) error
- func DelWsCredentials(serverKey string)
- func DeleteUserResourceRole(urr *models.BcsUserResourceRole) error
- func GetCluster(clusterId string) *models.BcsCluster
- func GetCredentials(clusterId string) *models.BcsClusterCredential
- func GetRegisterToken(clusterId string) *models.BcsRegisterToken
- func GetRole(RoleName string) *models.BcsRole
- func GetUrrByCondition(cond *models.BcsUserResourceRole) *models.BcsUserResourceRole
- func GetUserByCondition(cond *models.BcsUser) *models.BcsUser
- func GetWsCredentials(serverKey string) *models.BcsWsClusterCredentials
- func GetWsCredentialsByClusterId(clusterId string) []*models.BcsWsClusterCredentials
- func InitCoreDatabase(conf *config.UserMgrConfig) error
- func ListCredentials() []models.BcsClusterCredential
- func ListOldCredentials() []models.ClusterCredentials
- func QueryTkeCidr(tkeCidr *models.TkeCidr) *models.TkeCidr
- func SaveCredentials(clusterId, serverAddresses, caCertData, userToken, clusterDomain string) error
- func SaveTkeCidr(vpc, cidr string, ipNumber uint, status, cluster string) error
- func SaveWsCredentials(serverKey, clientModule, serverAddress, caCertData, userToken string) error
- func UpdateTkeCidr(tkeCidr, updatedTkeCidr *models.TkeCidr) error
- func UpdateUser(user, updatedUser *models.BcsUser) error
- type CidrCount
Constants ¶
View Source
const ( CidrStatusAvailable = "available" CidrStatusUsed = "used" CidrStatusReserved = "reserved" )
View Source
const ( // expired after 24 hours PlainUserExpiredTime = 24 * time.Hour // this means never expired AdminSaasUserExpiredTime = 10 * 365 * 24 * time.Hour )
View Source
const ( AdminUser = iota + 1 SaasUser PlainUser )
View Source
const RegisterTokenLen = 128
Variables ¶
View Source
var GCoreDB *gorm.DB
Functions ¶
func CreateCluster ¶
func CreateCluster(cluster *models.BcsCluster) error
func CreateRegisterToken ¶
CreateResterToken creates a new registerToken for given clusterId
func CreateRole ¶
func CreateUser ¶
func CreateUserResourceRole ¶
func CreateUserResourceRole(urr *models.BcsUserResourceRole) error
func DelWsCredentials ¶
func DelWsCredentials(serverKey string)
func DeleteUserResourceRole ¶
func DeleteUserResourceRole(urr *models.BcsUserResourceRole) error
func GetCluster ¶
func GetCluster(clusterId string) *models.BcsCluster
func GetCredentials ¶
func GetCredentials(clusterId string) *models.BcsClusterCredential
GetCredentials query for clusterCredentials by clusterId
func GetRegisterToken ¶
func GetRegisterToken(clusterId string) *models.BcsRegisterToken
GetRegisterToken return the registerToken by clusterId
func GetUrrByCondition ¶
func GetUrrByCondition(cond *models.BcsUserResourceRole) *models.BcsUserResourceRole
Query BcsUserResourceRole by condition
func GetUserByCondition ¶
Query user by condition
func GetWsCredentials ¶
func GetWsCredentials(serverKey string) *models.BcsWsClusterCredentials
GetWsCredentials query for clusterCredentials of cluster registered by websocket
func GetWsCredentialsByClusterId ¶
func GetWsCredentialsByClusterId(clusterId string) []*models.BcsWsClusterCredentials
func InitCoreDatabase ¶
func InitCoreDatabase(conf *config.UserMgrConfig) error
func ListCredentials ¶
func ListCredentials() []models.BcsClusterCredential
func ListOldCredentials ¶
func ListOldCredentials() []models.ClusterCredentials
func SaveCredentials ¶
SaveCredentials saves the current cluster credentials
func SaveWsCredentials ¶
SaveWsCredentials saves the credentials of cluster registered by websocket
func UpdateTkeCidr ¶
func UpdateUser ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.