service

package
v0.0.0-...-234d524 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func HashPassword

func HashPassword(password string) (string, error)

Types

type AuthenticationService

type AuthenticationService struct {
	DB *gorm.DB
}

func (*AuthenticationService) AuthUser

func (*AuthenticationService) GetAll

func (*AuthenticationService) Login

func (a *AuthenticationService) Login(ctx context.Context, username string, password string) (database.UserOut, string, error)

func (*AuthenticationService) Register

func (a *AuthenticationService) Register(ctx context.Context, user database.UserIn) (string, error)

type Service

type Service interface {
	Login(ctx context.Context, username string, password string) (database.UserOut, string, error)
	Register(ctx context.Context, user database.UserIn) (string, error)
	GetAll(ctx context.Context) ([]database.UserOut, error)
	AuthUser(ctx context.Context) (database.UserOut, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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