services

package
v0.0.0-...-c4b14b8 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	DB AuthInterface
}

func (*Auth) CreateUser

func (a *Auth) CreateUser(cfg config.Config, user *models.User) (primitive.ObjectID, error)

func (*Auth) GetEmail

func (a *Auth) GetEmail(email string) string

func (*Auth) GetTokenPair

func (a *Auth) GetTokenPair(cfg config.Config, email, password string) (*models.TokenPair, error)

func (*Auth) GetUserByEmail

func (a *Auth) GetUserByEmail(email, password string) (*models.User, error)

func (*Auth) Refresh

func (a *Auth) Refresh(userID primitive.ObjectID, cfg config.Config) (*models.TokenPair, error)

type AuthInterface

type AuthInterface interface {
	GetEmail(email string) string
	Create(user *models.User) (primitive.ObjectID, error)
	GetUserByEmail(email, password string) (*models.User, error)
}

type Services

type Services struct {
	Auth
}

func NewService

func NewService(storage StorageInteface) Services

type StorageInteface

type StorageInteface interface {
	AuthInterface
}

Jump to

Keyboard shortcuts

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