Documentation ¶
Index ¶
- type Hasher
- type PostgresStore
- func (s *PostgresStore) Authenticate(ctx context.Context, email, password string) (int64, error)
- func (s *PostgresStore) ChangePassword(ctx context.Context, id int64, oldPassword, newPassword string) error
- func (store *PostgresStore) NewResetToken(ctx context.Context, email string) (accounts.Account, bool, error)
- func (s *PostgresStore) SetForgottenPassword(ctx context.Context, id int64, password, resetToken string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PostgresStore ¶
type PostgresStore struct {
// contains filtered or unexported fields
}
PostgresStore saves account info in Postgres.
func NewPostgresStore ¶
func NewPostgresStore(pool *pgxpool.Pool, hasher Hasher) *PostgresStore
NewPostgresStore returns a Store which can manage accounts. The returned Store.Close() function will *not* close the pool, since we did not open it.
func (*PostgresStore) Authenticate ¶
See the docs on interfaces in store.go
func (*PostgresStore) ChangePassword ¶
func (s *PostgresStore) ChangePassword(ctx context.Context, id int64, oldPassword, newPassword string) error
See the docs on interfaces in store.go
func (*PostgresStore) NewResetToken ¶
func (store *PostgresStore) NewResetToken(ctx context.Context, email string) (accounts.Account, bool, error)
See the docs on interfaces in store.go
func (*PostgresStore) SetForgottenPassword ¶
func (s *PostgresStore) SetForgottenPassword(ctx context.Context, id int64, password, resetToken string) error
See the docs on interfaces in store.go
Click to show internal directories.
Click to hide internal directories.