Documentation ¶
Index ¶
- func CheckResetTokenValidity(username, token string) types.M
- func Create(auth *Auth, className string, object types.M, clientSDK map[string]string) (types.M, error)
- func Delete(auth *Auth, className, objectID string) error
- func Find(auth *Auth, className string, where, options types.M, ...) (types.M, error)
- func Get(auth *Auth, className, objectID string, options types.M, ...) (types.M, error)
- func ResendVerificationEmail(username string) error
- func SendPasswordResetEmail(email string) error
- func SendVerificationEmail(user types.M)
- func SetEmailVerifyToken(user types.M)
- func Update(auth *Auth, className, objectID string, object types.M, ...) (types.M, error)
- func UpdatePassword(username, token, newPassword string) error
- func VerifyEmail(username, token string) bool
- type AccountLockout
- type Auth
- func GetAuthForLegacySessionToken(sessionToken, installationID string, info *types.RequestInfo) (*Auth, error)
- func GetAuthForSessionToken(sessionToken string, installationID string, info *types.RequestInfo) (*Auth, error)
- func Master(info ...*types.RequestInfo) *Auth
- func Nobody(info ...*types.RequestInfo) *Auth
- func ReadOnly(info ...*types.RequestInfo) *Auth
- type Destroy
- type Query
- type Write
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResetTokenValidity ¶
CheckResetTokenValidity 检查要重置密码的用户与 token 是否存在
func Create ¶
func Create(auth *Auth, className string, object types.M, clientSDK map[string]string) (types.M, error)
Create 创建对象 返回数据格式如下:
{ "status":201, "response":{...}, "location":"http://..." }
func Find ¶
func Find(auth *Auth, className string, where, options types.M, clientSDK map[string]string) (types.M, error)
Find 根据条件查找数据 返回格式如下:
{ "results":[ {...}, ], "count":10 }
func Get ¶
func Get(auth *Auth, className, objectID string, options types.M, clientSDK map[string]string) (types.M, error)
Get ...
func ResendVerificationEmail ¶
ResendVerificationEmail 重新发送验证邮件
func SendPasswordResetEmail ¶
SendPasswordResetEmail 发送密码重置邮件
func Update ¶
func Update(auth *Auth, className, objectID string, object types.M, clientSDK map[string]string) (types.M, error)
Update 更新对象 返回更新后的字段,一般只有 updatedAt
func UpdatePassword ¶
UpdatePassword 更新指定用户的密码
Types ¶
type AccountLockout ¶
type AccountLockout struct {
// contains filtered or unexported fields
}
AccountLockout 密码错误达到一定次数,锁定账户
func NewAccountLockout ¶
func NewAccountLockout(username string) *AccountLockout
NewAccountLockout ...
func (*AccountLockout) HandleLoginAttempt ¶
func (a *AccountLockout) HandleLoginAttempt(loginSuccessful bool) error
HandleLoginAttempt 处理登录结果
type Auth ¶
type Auth struct { IsMaster bool IsReadOnly bool InstallationID string User types.M UserRoles []string FetchedRoles bool RolePromise []string Info *types.RequestInfo }
Auth 保存当前请求的用户权限信息
func GetAuthForLegacySessionToken ¶
func GetAuthForLegacySessionToken(sessionToken, installationID string, info *types.RequestInfo) (*Auth, error)
GetAuthForLegacySessionToken 处理保存在 _User 中的 sessionToken。 该方法处理从 parse 中迁移过来的用户数据,在 tomato 中其实不需要处理这种类型的数据,以后考虑删除
func GetAuthForSessionToken ¶
func GetAuthForSessionToken(sessionToken string, installationID string, info *types.RequestInfo) (*Auth, error)
GetAuthForSessionToken 返回 sessionToken 对应的用户权限信息
func (*Auth) CouldUpdateUserID ¶
CouldUpdateUserID Master 与当前用户可进行修改
type Destroy ¶
type Destroy struct {
// contains filtered or unexported fields
}
Destroy 删除对象
func NewDestroy ¶
NewDestroy 组装 Destroy
type Query ¶
Query 处理查询请求的结构体
type Write ¶
Write ...
Click to show internal directories.
Click to hide internal directories.