service

package
v0.0.1-bate.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

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 NewWebService(c config.Config, e *ent.Client, hc *http.Client, cache cache.Cache, prikey *rsa.PrivateKey) *WebService

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) EditUser

func (w *WebService) EditUser(ctx context.Context, u model.EditUser, uid int) error

func (*WebService) GetConfig

func (w *WebService) GetConfig(ctx context.Context) model.Config

func (*WebService) Info

func (*WebService) IsAdmin

func (w *WebService) IsAdmin(ctx context.Context, t *model.TokenClaims) error

func (*WebService) ListUser

func (w *WebService) ListUser(ctx context.Context, page int, email, name string) ([]model.UserList, int, error)

func (*WebService) Login

func (w *WebService) Login(ctx context.Context, l model.Login, ip string) (model.LoginRep, error)

func (*WebService) PutTexture

func (w *WebService) PutTexture(ctx context.Context, t *model.TokenClaims, texturebyte []byte, model string, textureType string) error

func (*WebService) Reg

func (w *WebService) Reg(ctx context.Context, u model.UserReg, ipPrefix, ip string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL