user

package
v0.0.0-...-e46c3b8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrEmailTaken

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

ErrEmailTaken signals that user exists for the given email address.

func (ErrEmailTaken) Context

func (err ErrEmailTaken) Context() ctxerr.Context

Context returns error Context.

func (ErrEmailTaken) Error

func (err ErrEmailTaken) Error() string

func (ErrEmailTaken) HttpStatusCode

func (err ErrEmailTaken) HttpStatusCode() int

HttpStatusCode returns http status code for the error.

func (ErrEmailTaken) Text

func (err ErrEmailTaken) Text() string

Text returns human readable error text.

func (ErrEmailTaken) Unwrap

func (err ErrEmailTaken) Unwrap() error

type ErrInvalCredents

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

ErrInvalCredents signals that invalid authentication credentials were given.

func (ErrInvalCredents) Context

func (err ErrInvalCredents) Context() ctxerr.Context

Context returns error Context.

func (ErrInvalCredents) Error

func (err ErrInvalCredents) Error() string

func (ErrInvalCredents) HttpStatusCode

func (err ErrInvalCredents) HttpStatusCode() int

HttpStatusCode returns http status code for the error.

func (ErrInvalCredents) Text

func (err ErrInvalCredents) Text() string

Text returns human readable error text.

func (ErrInvalCredents) Unwrap

func (err ErrInvalCredents) Unwrap() error

type Service

type Service interface {
	Register(ctx context.Context, user data.User) ctxerr.Error
	Authenticate(ctx context.Context, data data.Auth) (model.User, ctxerr.Error)
}

Service abstracts the user service.

func Use

func Use(repo repo.UserRepo, logger *zap.Logger, validate *validator.Validate) Service

Use creates a user Service.

Jump to

Keyboard shortcuts

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