Documentation ¶
Index ¶
- Constants
- func AddCloudBeaverInstance(client *gqlClient.Client, sqleInst *sqleModel.Instance) error
- func GenerateCloudBeaverDriverID(sqleInst *sqleModel.Instance) (string, error)
- func GenerateCloudBeaverUserName(name string) string
- func GetCurrentCloudBeaverUserID(ctx echo.Context) (string, bool, error)
- func GetGQLClient(username, password string) (*gqlClient.Client, error)
- func GetGQLClientWithRootUser() (*gqlClient.Client, error)
- func GetGqlServerURI() string
- func GetSQLEGQLClientWithCurrentUser(ctx echo.Context) (*gqlClient.Client, error)
- func GetSQLEGqlServerURI() string
- func InitSQLQueryConfig(sqlePort int, sqleEnableHttps bool, c config.SQLQueryConfig)
- func IsCloudBeaverConfigured() bool
- func IsReserved(name string) bool
- func Login(user, pwd string) (cookie []*http.Cookie, err error)
- func LoginToCBServer(user, pwd string) (cookie []*http.Cookie, err error)
- func RestoreFromCloudBeaverUserName(name string) string
- func SyncCurrentUser(cloudBeaverUser string) error
- func SyncInstance(sqleInstances map[uint]*sqleModel.Instance) error
- func SyncUserBindInstance(cbUserID string) error
- func SyncVisibleInstance(cbUserCache *sqleModel.CloudBeaverUserCache, sqleUser *sqleModel.User, ...) error
- func UpdateCloudBeaverInstance(client *gqlClient.Client, cbInstID string, sqleInst *sqleModel.Instance) error
- type AuditResult
- type SQLQueryConfig
Constants ¶
View Source
const ( CbRootUri = "/sql_query" CbGqlApi = "/api/gql" CBUserRole = "user" )
View Source
const ( GetUserConnectionsQuery = `` /* 231-byte string literal not displayed */ SetUserConnectionsQuery = `` /* 169-byte string literal not displayed */ )
View Source
const ( IsUserExistQuery = `` /* 143-byte string literal not displayed */ UpdatePasswordQuery = `` /* 172-byte string literal not displayed */ CreateUserQuery = `` /* 156-byte string literal not displayed */ GrantUserRoleQuery = ` query grantUserRole($userId: ID!, $roleId: ID!) { grantUserRole(userId: $userId, roleId: $roleId) }` )
View Source
const CBNamePrefix = "sqle-"
View Source
const (
CreateConnectionQuery = `` /* 240-byte string literal not displayed */
)
View Source
const (
GetActiveUserQuery = `
query getActiveUser {
user: activeUser {
userId
}
}
`
)
View Source
const LoginQuery = `` /* 189-byte string literal not displayed */
View Source
const (
UpdateConnectionQuery = `` /* 240-byte string literal not displayed */
)
Variables ¶
This section is empty.
Functions ¶
func AddCloudBeaverInstance ¶
AddCloudBeaverInstance 添加实例后会同步缓存
func GetGqlServerURI ¶
func GetGqlServerURI() string
func GetSQLEGqlServerURI ¶
func GetSQLEGqlServerURI() string
func InitSQLQueryConfig ¶
func InitSQLQueryConfig(sqlePort int, sqleEnableHttps bool, c config.SQLQueryConfig)
func IsCloudBeaverConfigured ¶
func IsCloudBeaverConfigured() bool
func IsReserved ¶
IsReserved 会检查用户名是否为无法使用的名称, 比如admin和user是角色名, 按照CloudBeaver的要求角色名无法作为用户名
func LoginToCBServer ¶
LoginToCBServer 的登录请求会直接被转发, 不会被中间件拦截处理
func SyncCurrentUser ¶
func SyncUserBindInstance ¶
func SyncVisibleInstance ¶
Types ¶
type AuditResult ¶
type SQLQueryConfig ¶
type SQLQueryConfig struct { config.SQLQueryConfig SqlePort int SqleEnableHttps bool }
func GetSQLQueryConfig ¶
func GetSQLQueryConfig() *SQLQueryConfig
Click to show internal directories.
Click to hide internal directories.