service

package
v0.0.0-...-d3ff880 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 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 AuditClient

type AuditClient interface {
	SendLogRequest(ctx context.Context, req audit.LogItem) error
}

type PasswordHasher

type PasswordHasher interface {
	Hash(password string) (string, error)
}

PasswordHasher provides hashing logic to securely store passwords.

type SessionsRepository

type SessionsRepository interface {
	Create(ctx context.Context, token domain.RefreshSession) error
	Get(ctx context.Context, token string) (domain.RefreshSession, error)
}

type Users

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

func NewUsers

func NewUsers(repo UsersRepository, sessionsRepo SessionsRepository, auditClient AuditClient, hasher PasswordHasher, secret []byte) *Users

func (*Users) ParseToken

func (s *Users) ParseToken(ctx context.Context, token string) (int64, error)

func (*Users) RefreshTokens

func (s *Users) RefreshTokens(ctx context.Context, refreshToken string) (string, string, error)

func (*Users) SignIn

func (s *Users) SignIn(ctx context.Context, inp domain.SignInInput) (string, string, error)

func (*Users) SignUp

func (s *Users) SignUp(ctx context.Context, inp domain.SignUpInput) error

type UsersRepository

type UsersRepository interface {
	Create(ctx context.Context, user domain.User) error
	GetByCredentials(ctx context.Context, email, password string) (domain.User, error)
	CheckUserExist(ctx context.Context, email string) (bool, error)
}

Jump to

Keyboard shortcuts

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