Documentation
¶
Index ¶
- type AuthHandler
- func (a AuthHandler) EncryptPassword(s string) string
- func (a AuthHandler) LoginWithPassword(ctx context.Context, option types.LoginOptions) (token.Pair, error)
- func (a AuthHandler) RegisterNewUser(ctx context.Context, option types.RegisterOptions) (*ent.User, error)
- func (a AuthHandler) ResetPassword(ctx context.Context, option types.ResetOptions) error
- type CaptchaHandler
- type EmailConsumer
- type EmailHandler
- type HealthHandler
- type UserHandler
- func (u UserHandler) CreateUser(ctx context.Context, username string, email string, password string) (types2.UserInfo, error)
- func (u UserHandler) FindByUID(ctx context.Context, uid string) (types2.UserInfo, error)
- func (u UserHandler) ListUserByPage(ctx context.Context, page, size int, pattern string) (types2.UserSearchResult, error)
- func (u UserHandler) RemoveUser(ctx context.Context, uid string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthHandler ¶
type AuthHandler struct { Token *token.Resolver UserRepo repo.UserRepo CaptchaHandler CaptchaHandler }
AuthHandler is responsible for user authentication
func (AuthHandler) EncryptPassword ¶
func (a AuthHandler) EncryptPassword(s string) string
EncryptPassword encrypts password with sha512
func (AuthHandler) LoginWithPassword ¶
func (a AuthHandler) LoginWithPassword(ctx context.Context, option types.LoginOptions) (token.Pair, error)
LoginWithPassword user login by password
func (AuthHandler) RegisterNewUser ¶
func (a AuthHandler) RegisterNewUser(ctx context.Context, option types.RegisterOptions) (*ent.User, error)
RegisterNewUser registers new user and returns it
func (AuthHandler) ResetPassword ¶
func (a AuthHandler) ResetPassword(ctx context.Context, option types.ResetOptions) error
ResetPassword resets specified user password and returns uid
type CaptchaHandler ¶
type CaptchaHandler struct { CaptchaCache cache.CaptchaCache EmailHandler EmailHandler MetaInfo conf.MetaInfo }
func (CaptchaHandler) SendCaptchaEmail ¶
SendCaptchaEmail send a verify code email to the specified address
type EmailConsumer ¶
type EmailConsumer struct {
// contains filtered or unexported fields
}
EmailConsumer is responsible for reading messages from Queue and then send these emails.
func (*EmailConsumer) Group ¶
func (c *EmailConsumer) Group() string
func (*EmailConsumer) Name ¶
func (c *EmailConsumer) Name() string
func (*EmailConsumer) Size ¶
func (c *EmailConsumer) Size() int64
func (*EmailConsumer) Topic ¶
func (c *EmailConsumer) Topic() string
type EmailHandler ¶
EmailHandler is responsible for publishing and sending emails
func NewEmailHandler ¶
type HealthHandler ¶
type HealthHandler struct { }
type UserHandler ¶
func (UserHandler) CreateUser ¶
func (UserHandler) ListUserByPage ¶
func (u UserHandler) ListUserByPage(ctx context.Context, page, size int, pattern string) (types2.UserSearchResult, error)
func (UserHandler) RemoveUser ¶
func (u UserHandler) RemoveUser(ctx context.Context, uid string) error
Click to show internal directories.
Click to hide internal directories.