Documentation ¶
Index ¶
- Variables
- type ErrTurnstile
- type WebService
- func (w *WebService) Auth(ctx context.Context, token string) (*model.TokenClaims, error)
- func (w *WebService) ChangeName(ctx context.Context, newName string, t *model.TokenClaims) error
- func (w *WebService) ChangePasswd(ctx context.Context, p model.ChangePasswd, t *model.TokenClaims) error
- func (w *WebService) EditUser(ctx context.Context, u model.EditUser, uid int) error
- func (w *WebService) GetConfig(ctx context.Context) model.Config
- func (w *WebService) Info(ctx context.Context, t *model.TokenClaims) (model.UserInfo, error)
- func (w *WebService) IsAdmin(ctx context.Context, t *model.TokenClaims) error
- func (w *WebService) ListUser(ctx context.Context, page int, email, name string) ([]model.UserList, int, error)
- func (w *WebService) Login(ctx context.Context, l model.Login, ip string) (model.LoginRep, error)
- func (w *WebService) PutTexture(ctx context.Context, t *model.TokenClaims, texturebyte []byte, model string, ...) error
- func (w *WebService) Reg(ctx context.Context, u model.UserReg, ipPrefix, ip string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrExistUser = errors.New("邮箱已存在") ErrExitsName = errors.New("用户名已存在") ErrRegLimit = errors.New("超过注册 ip 限制") ErrPassWord = errors.New("错误的密码或用户名") ErrChangeName = errors.New("离线模式 uuid 不允许修改用户名") )
View Source
var ErrCaptcha = errors.New("验证码错误")
View Source
var ErrNotAdmin = errors.New("无权限")
Functions ¶
This section is empty.
Types ¶
type ErrTurnstile ¶
type ErrTurnstile struct {
ErrorCodes []string
}
func (ErrTurnstile) Error ¶
func (e ErrTurnstile) Error() string
type WebService ¶
type WebService struct {
// contains filtered or unexported fields
}
func NewWebService ¶
func (*WebService) Auth ¶
func (w *WebService) Auth(ctx context.Context, token string) (*model.TokenClaims, error)
func (*WebService) ChangeName ¶
func (w *WebService) ChangeName(ctx context.Context, newName string, t *model.TokenClaims) error
func (*WebService) ChangePasswd ¶
func (w *WebService) ChangePasswd(ctx context.Context, p model.ChangePasswd, t *model.TokenClaims) error
func (*WebService) Info ¶
func (w *WebService) Info(ctx context.Context, t *model.TokenClaims) (model.UserInfo, error)
func (*WebService) IsAdmin ¶
func (w *WebService) IsAdmin(ctx context.Context, t *model.TokenClaims) error
func (*WebService) PutTexture ¶
func (w *WebService) PutTexture(ctx context.Context, t *model.TokenClaims, texturebyte []byte, model string, textureType string) error
Click to show internal directories.
Click to hide internal directories.