service

package
v0.0.0-...-cc0c475 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

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

Account service

func NewAccount

func NewAccount(repo repo.UserRepo) *Account

NewAccount create new account service

func (*Account) Login

func (a *Account) Login(ctx context.Context, email, password string) (*model.User, error)

Login check account login and generate user token

func (*Account) Logout

func (a *Account) Logout(ctx context.Context, email string) error

func (*Account) PasswordResetToken

func (a *Account) PasswordResetToken(ctx context.Context, email string) (string, error)

func (*Account) Register

func (a *Account) Register(ctx context.Context, user *model.User) (*model.User, error)

Register create new account

func (*Account) ResetPassword

func (a *Account) ResetPassword(ctx context.Context, token, password string) (*model.User, error)

func (*Account) VerifyEmailToken

func (a *Account) VerifyEmailToken(ctx context.Context, token string) (*model.User, error)

func (*Account) VerifyToken

func (a *Account) VerifyToken(ctx context.Context, token string) (string, error)

type AccountService

type AccountService interface {
	Login(ctx context.Context, email, password string) (*model.User, error)
	Logout(ctx context.Context, email string) error
	Register(ctx context.Context, user *model.User) (*model.User, error)
	PasswordResetToken(ctx context.Context, email string) (string, error)
	VerifyToken(ctx context.Context, token string) (string, error)
	VerifyEmailToken(ctx context.Context, token string) (*model.User, error)
	ResetPassword(ctx context.Context, token, password string) (*model.User, error)
}

AccountService account service interface

Jump to

Keyboard shortcuts

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