Documentation ¶
Index ¶
- func GetUserService() (svc interfaces.UserService, err error)
- func NewUserService() (svc2 interfaces.UserService, err error)
- type Option
- type Service
- func (svc *Service) ChangePassword(id primitive.ObjectID, password string, args ...interface{}) (err error)
- func (svc *Service) CheckToken(tokenStr string) (u interfaces.User, err error)
- func (svc *Service) Create(opts *interfaces.UserCreateOptions, args ...interface{}) (err error)
- func (svc *Service) GetCurrentUser(c *gin.Context) (user interfaces.User, err error)
- func (svc *Service) Init() (err error)
- func (svc *Service) Login(opts *interfaces.UserLoginOptions) (token string, u interfaces.User, err error)
- func (svc *Service) MakeToken(user interfaces.User) (tokenStr string, err error)
- func (svc *Service) SetJwtSecret(secret string)
- func (svc *Service) SetJwtSigningMethod(method jwt.SigningMethod)
- type ServiceV2
- func (svc *ServiceV2) ChangePassword(id primitive.ObjectID, password string, by primitive.ObjectID) (err error)
- func (svc *ServiceV2) CheckToken(tokenStr string) (u *models.UserV2, err error)
- func (svc *ServiceV2) Create(username, password, role, email string, by primitive.ObjectID) (err error)
- func (svc *ServiceV2) GetCurrentUser(c *gin.Context) (user interfaces.User, err error)
- func (svc *ServiceV2) Init() (err error)
- func (svc *ServiceV2) Login(username, password string) (token string, u *models.UserV2, err error)
- func (svc *ServiceV2) MakeToken(user *models.UserV2) (tokenStr string, err error)
- func (svc *ServiceV2) SetJwtSecret(secret string)
- func (svc *ServiceV2) SetJwtSigningMethod(method jwt.SigningMethod)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetUserService ¶
func GetUserService() (svc interfaces.UserService, err error)
func NewUserService ¶
func NewUserService() (svc2 interfaces.UserService, err error)
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ChangePassword ¶
func (*Service) CheckToken ¶
func (svc *Service) CheckToken(tokenStr string) (u interfaces.User, err error)
func (*Service) Create ¶
func (svc *Service) Create(opts *interfaces.UserCreateOptions, args ...interface{}) (err error)
func (*Service) GetCurrentUser ¶
func (*Service) Login ¶
func (svc *Service) Login(opts *interfaces.UserLoginOptions) (token string, u interfaces.User, err error)
func (*Service) MakeToken ¶
func (svc *Service) MakeToken(user interfaces.User) (tokenStr string, err error)
func (*Service) SetJwtSecret ¶
func (*Service) SetJwtSigningMethod ¶
func (svc *Service) SetJwtSigningMethod(method jwt.SigningMethod)
type ServiceV2 ¶
type ServiceV2 struct {
// contains filtered or unexported fields
}
func GetUserServiceV2 ¶
func (*ServiceV2) ChangePassword ¶
func (*ServiceV2) CheckToken ¶
func (*ServiceV2) GetCurrentUser ¶
func (*ServiceV2) SetJwtSecret ¶
func (*ServiceV2) SetJwtSigningMethod ¶
func (svc *ServiceV2) SetJwtSigningMethod(method jwt.SigningMethod)
Click to show internal directories.
Click to hide internal directories.