service

package
v0.0.0-...-618fe63 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthService

type AuthService interface {
	// Add your methods here
	Register(ctx context.Context, Username, Password, Name, LastName, Phone, Email string) (Response model.User, err error)

	// Username: Username, password password
	// Username: Phone, password password
	LoginUP(ctx context.Context, Username, Password string) (Response model.User, err error)

	// Phone: phone
	LoginP(ctx context.Context, Phone string) (Response model.User, err error)

	// token: A4613Ac9...., Type: JWT_TOKEN, Code: ....
	Verify(ctx context.Context, Token, Type, Code string) (Response model.User, err error)
}

AuthService describes the service.

func New

func New(middleware []Middleware) AuthService

New returns a AuthService with all of the expected middleware wired in.

func NewBasicAuthService

func NewBasicAuthService() AuthService

NewBasicAuthService returns a naive, stateless implementation of AuthService.

type Middleware

type Middleware func(AuthService) AuthService

Middleware describes a service middleware.

func LoggingMiddleware

func LoggingMiddleware(logger log.Logger) Middleware

LoggingMiddleware takes a logger as a dependency and returns a AuthService Middleware.

Jump to

Keyboard shortcuts

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