Documentation
¶
Index ¶
- type Authentication
- type Entity
- func (e *Entity) CreateAuthentication(ctx context.Context, userId int64, email, passwordHash string) error
- func (e *Entity) CreateRecovery(ctx context.Context, userId int64, token string, expires time.Time) error
- func (e *Entity) GetAuthenticationByEmail(ctx context.Context, email string) (model.Authentication, error)
- func (e *Entity) GetAuthenticationByUserId(ctx context.Context, userId int64) (model.Authentication, error)
- func (e *Entity) GetRecovery(ctx context.Context, userId int64, token string) (model.Recovery, error)
- func (e *Entity) GetRecoveryByUserId(ctx context.Context, userId int64) (model.Recovery, error)
- func (e *Entity) RemoveAuthentication(ctx context.Context, userId int64) error
- func (e *Entity) RemoveRecovery(ctx context.Context, userId int64) error
- func (e *Entity) SetPasswordHash(ctx context.Context, userId int64, hash string) error
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 (*Entity) CreateRecovery ¶
func (*Entity) GetAuthenticationByEmail ¶
func (*Entity) GetAuthenticationByUserId ¶
func (*Entity) GetRecovery ¶
func (*Entity) GetRecoveryByUserId ¶
func (*Entity) RemoveAuthentication ¶
func (*Entity) RemoveRecovery ¶
Click to show internal directories.
Click to hide internal directories.