auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

Types

type Repository

type Repository interface {
	GetUserById(id string) (*entities.User, error)
	GetUserByEmail(email string) (*entities.User, error)
	GetUserByUsername(username string) (*entities.User, error)
	CreateUser(user entities.User) error
	ChangePassword(userId string, password string) error
}

func NewRepository

func NewRepository(db *sql.DB) Repository

type Service

type Service interface {
	Login(input entities.LoginInput) (string, error)
	Signup(input entities.SignupInput) (string, error)
	Me(userId string) (entities.User, error)
	ChangePassword(userId string, input entities.ChangePasswordInput) error
}

func NewService

func NewService(repo Repository) Service

Jump to

Keyboard shortcuts

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