authentication

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authentication

type Authentication interface {
	CreateAuthentication(ctx context.Context, userId int64, email, passwordHash string) error
	RemoveAuthentication(ctx context.Context, userId int64) error
	GetAuthenticationByEmail(ctx context.Context, email string) (model.Authentication, error)
	GetAuthenticationByUserId(ctx context.Context, userId int64) (model.Authentication, error)
	SetPasswordHash(ctx context.Context, userId int64, hash string) error
	CreateRecovery(ctx context.Context, userId int64, token string, expires time.Time) error
	RemoveRecovery(ctx context.Context, userId int64) error
	GetRecoveryByUserId(ctx context.Context, userId int64) (model.Recovery, error)
	GetRecovery(ctx context.Context, userId int64, token string) (model.Recovery, error)
}

func New

func New(c *sqlx.DB) Authentication

type Entity

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

func (*Entity) CreateAuthentication

func (e *Entity) CreateAuthentication(ctx context.Context, userId int64, email, passwordHash string) error

func (*Entity) CreateRecovery

func (e *Entity) CreateRecovery(ctx context.Context, userId int64, token string, expires time.Time) error

func (*Entity) GetAuthenticationByEmail

func (e *Entity) GetAuthenticationByEmail(ctx context.Context, email string) (model.Authentication, error)

func (*Entity) GetAuthenticationByUserId

func (e *Entity) GetAuthenticationByUserId(ctx context.Context, userId int64) (model.Authentication, error)

func (*Entity) GetRecovery

func (e *Entity) GetRecovery(ctx context.Context, userId int64, token string) (model.Recovery, error)

func (*Entity) GetRecoveryByUserId

func (e *Entity) GetRecoveryByUserId(ctx context.Context, userId int64) (model.Recovery, error)

func (*Entity) RemoveAuthentication

func (e *Entity) RemoveAuthentication(ctx context.Context, userId int64) error

func (*Entity) RemoveRecovery

func (e *Entity) RemoveRecovery(ctx context.Context, userId int64) error

func (*Entity) SetPasswordHash

func (e *Entity) SetPasswordHash(ctx context.Context, userId int64, hash string) error

Jump to

Keyboard shortcuts

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