Documentation
¶
Index ¶
- type Authentication
- type Entity
- func (e *Entity) BumpSessionVersionTx(ctx context.Context, tx *sqlx.Tx, userId int64) (int64, error)
- 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) GetSessionVersion(ctx context.Context, userId int64) (int64, error)
- func (e *Entity) RemoveAuthentication(ctx context.Context, userId int64) error
- func (e *Entity) RemoveRecovery(ctx context.Context, userId int64) error
- func (e *Entity) RemoveRecoveryTx(ctx context.Context, tx *sqlx.Tx, userId int64) error
- func (e *Entity) SetPasswordHash(ctx context.Context, userId int64, hash string) error
- func (e *Entity) SetPasswordHashTx(ctx context.Context, tx *sqlx.Tx, 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)
GetSessionVersion(ctx context.Context, userId int64) (int64, error)
SetPasswordHash(ctx context.Context, userId int64, hash string) error
SetPasswordHashTx(ctx context.Context, tx *sqlx.Tx, userId int64, hash string) error
BumpSessionVersionTx(ctx context.Context, tx *sqlx.Tx, userId int64) (int64, error)
CreateRecovery(ctx context.Context, userId int64, token string, expires time.Time) error
RemoveRecovery(ctx context.Context, userId int64) error
RemoveRecoveryTx(ctx context.Context, tx *sqlx.Tx, 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) BumpSessionVersionTx ¶ added in v1.11.0
func (*Entity) CreateAuthentication ¶
func (*Entity) CreateRecovery ¶
func (*Entity) GetAuthenticationByEmail ¶
func (*Entity) GetAuthenticationByUserId ¶
func (*Entity) GetRecovery ¶
func (*Entity) GetRecoveryByUserId ¶
func (*Entity) GetSessionVersion ¶ added in v1.11.0
func (*Entity) RemoveAuthentication ¶
func (*Entity) RemoveRecovery ¶
func (*Entity) RemoveRecoveryTx ¶ added in v1.11.0
func (*Entity) SetPasswordHash ¶
Click to show internal directories.
Click to hide internal directories.