Documentation ¶
Index ¶
- Constants
- func IsEmailUsed(email string) bool
- func Login(str string, pass string, cid string) (*string, error)
- func MakeIdToken(c *Conversation) (*string, error)
- func MakeRefreshToken(c *Conversation)
- func RemoveConversation(uid string, cid string, pass string) error
- func UpdateClientStatus(cid string, status int) error
- func UpdateUserEmail(uid string, newEmail string) error
- func UpdateUserPassWord(uid string, pass string) error
- func UpdateUserStatus(uid string, status int) error
- type Client
- type Conversation
- type Id
- type Permission
- type Refresh
- type User
Constants ¶
View Source
const ClientIsDisable = "CLIENT_IS_DISABLE"
View Source
const EmailHasBeenUsed = "EMAIL_HAS_BEEN_USED"
View Source
const PassWordError = "PASS_WORLD_ERROR"
View Source
const TextFormatIsIllegal = "TEXT_FORMAT_IS_ILLEGAL"
View Source
const TokenHasError = "TOKEN_HAS_ERROR"
View Source
const UserNotFound = "USER_NOT_Found"
Error
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { Id string Key string Name string Status int Leave int Url string Permission string AdminUser string CreateTime int }
Client 定义了客户端对象,所有用户token都是基于客户端发放、验证 status 定义了客户端状态:-2 封禁,-1 禁用,0 启用 permission 定义了客户端所需权限,默认所有客户端有拥有唯一id权限 adminUser 定义了客户端管理员,管理员拥有客户端的全部权限,一个客户端仅允许一个管理员 leave 定义了客户端权限等级: -1 系统客户端,0 仅用于第三方登录,1 长期用户授权 ...
func AddClient ¶
type Conversation ¶
func AddConversation ¶
func AddConversation(uid string, cid string) (*Conversation, error)
type Id ¶
type Id struct {
// contains filtered or unexported fields
}
type Permission ¶
func AddPermission ¶
func AddPermission(depict string, depictZhCn string) (*Permission, error)
func GetPermission ¶
func GetPermission(id string) (*Permission, error)
type Refresh ¶
type Refresh struct {
// contains filtered or unexported fields
}
type User ¶
type User struct { Uid string Username string Email string Status int Nickname string Pass string Avatar string CreateTime int UpdateTime int CreateAddress string }
User定义了单个用户对象 status决定了这个用户的关键状态信息: -4已注销,-3已封禁,-2小黑屋,-1邮箱未验证,0:正常
func AddUser ¶
func CheckPassword ¶
/ 检查用户密码,str可以是 uid,用户名,和邮箱
Click to show internal directories.
Click to hide internal directories.