user

package
v0.0.0-...-b8d2545 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

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

Service load user service with model.User

func NewService

func NewService(log *logger.Logger, storage storage, cfg *config.Config) *Service

NewService creates new user service

func (*Service) Authenticate

func (svc *Service) Authenticate(userName string, password string) (bool, error)

Authenticate authenticates the provided credential

func (*Service) Create

func (svc *Service) Create(data model.UserInput, CreateUserID *int64) (*model.User, error)

Create creates a new user

func (*Service) EncryptPassword

func (svc *Service) EncryptPassword(password string, publicKeyRSA *rsa.PublicKey) ([]byte, error)

EncryptPassword encrypts password

func (*Service) GetById

func (svc *Service) GetById(userId int64) (*model.User, error)

GetById gets user data by ID

func (*Service) GetUserIdByUsername

func (svc *Service) GetUserIdByUsername(username string) (int, error)

GetUserIdByUsername gets user data by username

func (*Service) List

func (svc *Service) List(userIdStr, statusCd string) ([]*model.User, error)

List gets list of user

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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