user

package
v0.0.1-alpha5 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailMessage

type EmailMessage struct {
	ConfirmationURL string
}

EmailMessage holds our email struct

type Service

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

Service holds the user service struct

func NewUserService

func NewUserService(msg *gcontext.MessageService, db *sqlx.DB, log *logging.Logger, jwt *jwt.AuthService, tokenizer *tokenizer.Tokenizer, mailer *mailer.Service,
	deeplinker *deeplinker.FireBaseClient, builder *builder.BuilderService) *Service

NewUserService instantiates user service

func (*Service) FindByID

func (u *Service) FindByID(userID string) (*model.User, error)

func (*Service) Login

func (u *Service) Login(credentials *model.UserCredentials) (string, error)

Login return a jwt token if user is confirmed

func (*Service) Signup

func (u *Service) Signup(credentials *model.UserCredentials) string

Signup register a user in db and send an email and return instructions

func (*Service) VerifyUserToken

func (u *Service) VerifyUserToken(token string) (bool, error)

VerifyUserToken decode userid from token and verify if exists

Jump to

Keyboard shortcuts

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