MCPcopy Create free account

hub / github.com/aiyi/go-user / functions

Functions124 in github.com/aiyi/go-user

↓ 27 callersFunctionremoveFromCache
(userId int64)
model/cache.go:37
↓ 22 callersFunctionsyncToCache
(userId int64)
model/cache.go:47
↓ 7 callersMethodEncode
trim(url_base64(json(token))) + "." + hex(hmac-sha256(base64_str))
frontend/token/token.go:62
↓ 6 callersFunctionNewPasswordTag
()
model/password.go:17
↓ 3 callersMethodDecode
trim(url_base64(json(token))) + "." + hex(hmac-sha256(base64_str))
frontend/token/token.go:96
↓ 2 callersFunctionauthSuccess
认证成功后创建 token 和 session
frontend/user/auth.go:86
↓ 2 callersFunctiongenerateCode
生成6位随机数字
frontend/checkcode/generate.go:11
↓ 2 callersFunctionputToCache
(user *User)
model/cache.go:25
↓ 1 callersFunctionNewSalt
无主地 salt, 用于安全授权
model/password.go:12
↓ 1 callersFunctionauthEmailPassword
(ctx *gin.Context, querylValues url.Values)
frontend/user/auth.go:131
↓ 1 callersFunctionauthGuest
(ctx *gin.Context, queryValues url.Values)
frontend/user/auth.go:43
↓ 1 callersFunctionauthPhonePassword
(ctx *gin.Context, querylValues url.Values)
frontend/user/auth.go:172
↓ 1 callersFunctionbase64Pad
在编码尾部填充 '=', 使之符合 base64 编码规则. dst 可能引用了 src 的空间, src 之后的空间可能被污染(当 cap(src) > len(src) 时).
frontend/token/base64.go:18
↓ 1 callersFunctionbase64Trim
去掉 base64 编码尾部的 '='. dst 引用了 src 的空间.
frontend/token/base64.go:5
↓ 1 callersFunctionbindEmail
(userId int64, email string)
model/bind_email.go:24
↓ 1 callersFunctionbindEmailUserTo
(toUserId, userId int64)
model/bind_email_to.go:30
↓ 1 callersFunctionbindPhone
(userId int64, phone string)
model/bind_phone.go:24
↓ 1 callersFunctionbindPhoneUserTo
(toUserId, userId int64)
model/bind_phone_to.go:30
↓ 1 callersFunctionbindQQ
(userId int64, openid string)
model/bind_qq.go:24
↓ 1 callersFunctionbindQQUserTo
(toUserId, userId int64)
model/bind_qq_to.go:30
↓ 1 callersFunctionbindWechat
(userId int64, openid string)
model/bind_wechat.go:24
↓ 1 callersFunctionbindWechatUserTo
(toUserId, userId int64)
model/bind_wechat_to.go:30
↓ 1 callersFunctionbindWeibo
(userId int64, openid string)
model/bind_weibo.go:24
↓ 1 callersFunctionbindWeiboUserTo
(toUserId, userId int64)
model/bind_weibo_to.go:30
↓ 1 callersFunctiongetDSN
()
db/db.config.go:9
↓ 1 callersFunctiongetFromCache
从缓存里获取 user 信息, 如果没有找到返回 ErrNotFound.
model/cache.go:14
↓ 1 callersFunctiongetKey
从私密存储上获取安全key
securitykey/securitykey.config.go:10
↓ 1 callersFunctiongetServerList
()
mc/mc.config.go:9
↓ 1 callersFunctiongetSnowflakeWorkerId
集群环境下不能重复
userid/id.config.go:8
↓ 1 callersFunctionloadConfig
(cfg *Config)
config/config.go:51
↓ 1 callersFunctionsendCodeToEmail
(email, checkcode string)
frontend/checkcode/send_api.go:12
↓ 1 callersFunctionsendCodeToPhone
(phone, checkcode string)
frontend/checkcode/send_api.go:7
↓ 1 callersFunctionsetNickname
(userId int64, nickname string)
model/set.go:18
↓ 1 callersFunctionsetPassword
(userId int64, password, salt []byte)
model/set.go:39
↓ 1 callersFunctionunbindEmail
(userId int64)
model/unbind_email.go:23
↓ 1 callersFunctionunbindPhone
(userId int64)
model/unbind_phone.go:23
↓ 1 callersFunctionunbindQQ
(userId int64)
model/unbind_qq.go:23
↓ 1 callersFunctionunbindWechat
(userId int64)
model/unbind_wechat.go:23
↓ 1 callersFunctionunbindWeibo
(userId int64)
model/unbind_weibo.go:23
↓ 1 callersFunctionverifyEmail
(userId int64)
model/verify_account.go:18
↓ 1 callersFunctionverifyPhone
(userId int64)
model/verify_account.go:38
↓ 1 callersFunctionverifyQQ
(userId int64)
model/verify_account.go:58
↓ 1 callersFunctionverifyWechat
(userId int64)
model/verify_account.go:78
↓ 1 callersFunctionverifyWeibo
(userId int64)
model/verify_account.go:98
FunctionAdd
添加 sid-Session, 如果 sid 冲突则返回错误.
frontend/session/session.go:69
FunctionAddByEmail
通过 邮箱 注册一个账户. 如果 nickname 为空, 则默认为 email 校验码注册时, password, salt 可以为 nil 如果 timestamp == 0 则默认使用当前时间
model/add_email.go:14
FunctionAddByPhone
通过 手机 注册一个账户. 如果 nickname 为空, 则默认为 phone 校验码注册时, password, salt 可以为 nil 如果 timestamp == 0 则默认使用当前时间
model/add_phone.go:14
FunctionAddByQQ
通过 QQ 注册一个账户. 如果 nickname 为空, 则默认为 openid 如果 timestamp == 0 则默认使用当前时间
model/add_qq.go:13
FunctionAddByWechat
通过 微信 注册一个账户. 如果 nickname 为空, 则默认为 openid 如果 timestamp == 0 则默认使用当前时间
model/add_wechat.go:13
FunctionAddByWeibo
通过 微博 注册一个账户. 如果 nickname 为空, 则默认为 openid 如果 timestamp == 0 则默认使用当前时间
model/add_weibo.go:13
FunctionAuthHandler
认证, 获取token. uri?auth_type=guest uri?auth_type=email_password&email=XXX&password=XXX uri?auth_type=phone_password&phone=XXX&password=XXX uri?auth_type
frontend/user/auth.go:24
FunctionAuthHandler
微信 oauth2 认证 需要提供 code, state 参数.
frontend/oauth/wechat/open/app/auth.go:20
FunctionAuthHandler
微信 oauth2 认证 需要提供 code, state 参数.
frontend/oauth/wechat/open/web/auth.go:20
FunctionAuthHandler
微信公众号 oauth2 认证 需要提供 code, state 参数.
frontend/oauth/wechat/mp/auth.go:19
FunctionAuthParaHandler
获取请求用户授权的参数(appid, state, scope)
frontend/oauth/wechat/open/app/auth_para.go:15
FunctionAuthURLHandler
获取微信认证页面的 url 需要提供 redirect_uri
frontend/oauth/wechat/open/web/auth_url.go:19
FunctionAuthURLHandler
获取微信认证页面的 url 需要提供 redirect_uri
frontend/oauth/wechat/mp/auth_url.go:19
FunctionBindEmail
绑定邮箱(一般在认证后进行操作). 调用该函数前, 请确认: 1. 该用户存在并且 verified 2. 该用户未绑定邮箱 3. 该邮箱未绑定用户
model/bind_email.go:14
FunctionBindEmailUserTo
绑定邮箱新注册账户到指定账户, 密码以指定账户为准. 调用该函数前, 请确认: 1. toUserId != userId 2. toUserId 存在并且 verified 3. userId 存在并且没有 verified 4. toUserId 未绑定邮箱 5. userId 是邮箱新注册账户
model/bind_email_to.go:17
FunctionBindPhone
绑定手机(一般在认证后进行操作). 调用该函数前, 请确认: 1. 该用户存在并且 verified 2. 该用户未绑定手机 3. 该手机未绑定用户
model/bind_phone.go:14
FunctionBindPhoneUserTo
绑定手机新注册账户到指定账户, 密码以指定账户为准. 调用该函数前, 请确认: 1. toUserId != userId 2. toUserId 存在并且 verified 3. userId 存在并且没有 verified 4. toUserId 未绑定手机 5. userId 是手机新注册账户
model/bind_phone_to.go:17
FunctionBindQQ
绑定QQ(一般在认证后进行操作). 调用该函数前, 请确认: 1. 该用户存在并且 verified 2. 该用户未绑定QQ 3. 该QQ未绑定用户
model/bind_qq.go:14
FunctionBindQQUserTo
绑定QQ新注册账户到指定账户, 密码以指定账户为准. 调用该函数前, 请确认: 1. toUserId != userId 2. toUserId 存在并且 verified 3. userId 存在并且没有 verified 4. toUserId 未绑定QQ 5. userId 是QQ新注册账户
model/bind_qq_to.go:17
FunctionBindWechat
绑定微信(一般在认证后进行操作). 调用该函数前, 请确认: 1. 该用户存在并且 verified 2. 该用户未绑定微信 3. 该微信未绑定用户
model/bind_wechat.go:14
FunctionBindWechatUserTo
绑定微信新注册账户到指定账户, 密码以指定账户为准. 调用该函数前, 请确认: 1. toUserId != userId 2. toUserId 存在并且 verified 3. userId 存在并且没有 verified 4. toUserId 未绑定微信 5. userId 是微信新注册账户
model/bind_wechat_to.go:17
FunctionBindWeibo
绑定微博(一般在认证后进行操作). 调用该函数前, 请确认: 1. 该用户存在并且 verified 2. 该用户未绑定微博 3. 该微博未绑定用户
model/bind_weibo.go:14
FunctionBindWeiboUserTo
绑定微博新注册账户到指定账户, 密码以指定账户为准. 调用该函数前, 请确认: 1. toUserId != userId 2. toUserId 存在并且 verified 3. userId 存在并且没有 verified 4. toUserId 未绑定微博 5. userId 是微博新注册账户
model/bind_weibo_to.go:17
FunctionClient
()
mc/mc.go:18
FunctionCloseAllStmt
CloseAllStmt 关闭所有缓存的 Stmt, 释放资源. 一般情况下没有必要调用该函数.
db/db.go:35
FunctionCloseDB
CloseDB 关闭数据库连接, 释放资源. 一般情况下没有必要调用该函数.
db/db.go:29
FunctionCompareAndSwap
设置 sid-Session, 该 Session 是通过 Get 获取的, 如果在 Get 之后该 sid 对应的 Session 发生改变, 则返回错误.
frontend/session/session.go:53
FunctionDelete
删除 Session, 如果没有匹配则返回 errors.ErrNotFound.
frontend/session/session.go:97
FunctionEncryptPassword
(password, salt []byte)
model/password.go:21
MethodError
()
frontend/errors/error.go:22
FunctionExpirationAccess
(timestamp int64)
frontend/token/helper.go:11
FunctionExpirationRefresh
(timestamp int64)
frontend/token/helper.go:15
FunctionGet
获取 Session, 如果找不到返回 errors.ErrNotFound.
frontend/session/session.go:34
FunctionGet
(userId int64)
model/get.go:21
FunctionGetBindType
(AuthType string)
frontend/token/token.go:27
FunctionGetByEmail
(email string)
model/get.go:47
FunctionGetByPhone
(phone string)
model/get.go:63
FunctionGetByQQ
(openid string)
model/get.go:79
FunctionGetByWechat
(openid string)
model/get.go:95
FunctionGetByWeibo
(openid string)
model/get.go:111
FunctionGetDB
()
db/db.go:23
FunctionGetId
()
userid/id.go:19
FunctionGetNamedStmt
(query string)
db/db.go:79
FunctionGetStmt
(query string)
db/db.go:55
FunctionMustAuthAndNotGuestHandler
检查客户端是否是认证状态, 并且不是 guest 认证. 如果是, 添加 sso_token_string<-->x-token, sso_token<-->*token.Token, sso_session<-->*session.Session, sso_user<-->*model.User
frontend/middleware/must_auth_and_not_guest.go:19
FunctionMustAuthHandler
检查客户端是否是认证状态, 可以是 guest 认证. 如果是, 添加 sso_token_string<-->x-token, sso_token<-->*token.Token, sso_session<-->*session.Session, sso_user<-->*model.User
frontend/middleware/must_auth.go:19
FunctionNewError
(ErrCode int, ErrMsg string)
frontend/errors/error.go:15
FunctionNewGuestSessionId
^temp\.[A-Za-z0-9_-]+$
frontend/session/sid.go:18
FunctionNewSessionId
^[A-Za-z0-9_-]+$
frontend/session/sid.go:8
FunctionNewTokenId
()
frontend/token/helper.go:7
FunctionRefreshHandler
刷新 token
frontend/token/handler/refresh.go:17
FunctionRequestForEmailHandler
申请发送一个校验码到邮箱. uri?email=XXX
frontend/checkcode/handler.go:56
FunctionRequestForPhoneHandler
申请发送一个校验码到手机. uri?phone=XXX
frontend/checkcode/handler.go:15
FunctionSessionKey
(sid string)
mc/key.go:11
FunctionSet
无条件设置 sid-Session
frontend/session/session.go:83
FunctionSetNickname
修改昵称
model/set.go:8
next →1–100 of 124, ranked by callers