service

package
v0.0.0-...-2d053d8 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(db repository.UserDB, sf *utils.Snowflake) *UserService

NewUserService 返回一个 NewUserService 实例

func (*UserService) CheckPassword

func (svc *UserService) CheckPassword(passwordDigest, password string) error

func (*UserService) CreateUser

func (svc *UserService) CreateUser(ctx context.Context, u *model.User) (int64, error)

func (*UserService) EncryptPassword

func (svc *UserService) EncryptPassword(pwd string) (string, error)

func (*UserService) Verify

func (svc *UserService) Verify(opts ...UserVerifyOps) error

Verify 通过传来的参数进行一系列的校验

func (*UserService) VerifyEmail

func (svc *UserService) VerifyEmail(email string) UserVerifyOps

VerifyEmail 返回一个校验 email 格式的函数, 不应单独使用, 应结合 Verify

func (*UserService) VerifyPassword

func (svc *UserService) VerifyPassword(pw string) UserVerifyOps

VerifyPassword 返回一个校验 password 长度的函数, 不应单独使用, 应结合 Verify

type UserVerifyOps

type UserVerifyOps func() error

Jump to

Keyboard shortcuts

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