user

package
v0.6.0-beta.20220221.1800 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetUserService

func GetUserService(opts ...Option) (svc interfaces.UserService, err error)

func NewUserService

func NewUserService(opts ...Option) (svc2 interfaces.UserService, err error)

func ProvideGetUserService

func ProvideGetUserService(opts ...Option) func() (svr interfaces.UserService, err error)

func ProvideUserService

func ProvideUserService(opts ...Option) func() (svc interfaces.UserService, err error)

Types

type Option

type Option func(svc interfaces.UserService)

func WithJwtSecret

func WithJwtSecret(secret string) Option

type Service

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

func (*Service) ChangePassword

func (svc *Service) ChangePassword(id primitive.ObjectID, password string, args ...interface{}) (err error)

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 (svc *Service) GetCurrentUser(c *gin.Context) (user interfaces.User, err error)

func (*Service) Init

func (svc *Service) Init() (err error)

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 (svc *Service) SetJwtSecret(secret string)

func (*Service) SetJwtSigningMethod

func (svc *Service) SetJwtSigningMethod(method jwt.SigningMethod)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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