Documentation
¶
Index ¶
- func DestroyToken(ctx context.Context, s *server.Server, redisClient redis.UniversalClient, ...)
- func GetUserDEPIDs(deps [][]org.DepOneResponse) [][]string
- func GetUserInfo(ctx context.Context, u org.User, redisClient redis.UniversalClient, ...) (info *org.OneUserResponse, depID string, err error)
- func NewServer() *server.Server
- type CheckTokenResponse
- type DestroyTokenRequest
- type DestroyTokenResponse
- type FaasCheckReq
- type FaasCheckResp
- type JWTServer
- type LoginRequst
- type LoginResponse
- type OrgCheckRequest
- type OrgCheckResponse
- type SwitchTenantRequest
- type SwitchTenantResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DestroyToken ¶
func DestroyToken(ctx context.Context, s *server.Server, redisClient redis.UniversalClient, userID ...string)
DestroyToken destroy token by userID
func GetUserDEPIDs ¶
func GetUserDEPIDs(deps [][]org.DepOneResponse) [][]string
GetUserDEPIDs get org dep slice
Types ¶
type CheckTokenResponse ¶
CheckTokenResponse check token response
type DestroyTokenRequest ¶
type DestroyTokenRequest struct {
UsersID []string `json:"usersID"`
}
DestroyTokenRequest 接收用户id数组
type JWTServer ¶
type JWTServer interface { Login(ctx context.Context, r *LoginRequst) (*LoginResponse, error) Logout(ctx context.Context, tokenString string) (string, error) Refresh(ctx context.Context, refreshToken string) (interface{}, error) DestroyByUserID(ctx context.Context, req *DestroyTokenRequest) (*DestroyTokenResponse, error) CheckToken(c context.Context, header http.Header, token string) (response *CheckTokenResponse, err error) Auth(c context.Context, header http.Header, token string) (interface{}, error) FaasCheck(c context.Context, req *FaasCheckReq) (*FaasCheckResp, error) SwitchTenant(c context.Context, req *SwitchTenantRequest) (*SwitchTenantResponse, error) }
JWTServer interface
type LoginRequst ¶
type LoginRequst struct { UserName string `json:"username" binding:"required"` Password string `json:"password" binding:"required"` LoginType string `json:"login_type" binding:"required"` }
LoginRequst LoginRequst
type LoginResponse ¶
type LoginResponse struct {
Token map[string]interface{}
}
LoginResponse response
type OrgCheckRequest ¶
type OrgCheckRequest struct { UserName string `json:"username"` //多形态:邮箱、手机、其它 Password string `json:"password"` Types string `json:"types"` //登录模式 }
OrgCheckRequest 用于调用org服务
type OrgCheckResponse ¶
type OrgCheckResponse struct { UserID string `json:"userID"` UseStatus int `json:"useStatus"` //状态:1正常,-2禁用,-1删除 (与账号库相同) Code int64 `json:"code"` //错误码 Msg string `json:"msg"` //错误信息 }
OrgCheckResponse 返回用户信息
type SwitchTenantRequest ¶
SwitchTenantRequest switch tenant request
type SwitchTenantResponse ¶
type SwitchTenantResponse struct { }
SwitchTenantResponse switch tenant response
Click to show internal directories.
Click to hide internal directories.