Documentation
¶
Index ¶
- type Snippet
- func (s Snippet) Create(context.Context, snippet.NewSnippet, time.Time) (*snippet.Info, error)
- func (s Snippet) Delete(context.Context, string) error
- func (s Snippet) Latest(context.Context) ([]snippet.Info, error)
- func (s Snippet) Retrieve(ctx context.Context, id string) (*snippet.Info, error)
- func (s Snippet) Update(ctx context.Context, id string, us snippet.UpdateSnippet, t time.Time) error
- type User
- func (u User) Authenticate(ctx context.Context, now time.Time, email, password string) (auth.Claims, error)
- func (u User) ChangePassword(ctx context.Context, id, currentPassword, newPassword string) error
- func (u User) Create(ctx context.Context, nu user.NewUser, now time.Time) (*user.Info, error)
- func (u User) Delete(ctx context.Context, id string) error
- func (u User) List(ctx context.Context) ([]user.Info, error)
- func (u User) QueryByID(ctx context.Context, id string) (*user.Info, error)
- func (u User) Update(context.Context, string, user.UpdateUser, time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Snippet ¶
type Snippet struct{}
Snippet manages the set of API's for snippet access
type User ¶
type User struct { }
User manages the set of API's for user access. It wraps a sql.DB connection pool.
func (User) Authenticate ¶
func (u User) Authenticate(ctx context.Context, now time.Time, email, password string) (auth.Claims, error)
Authenticate finds a user by their email and verifies their password.
func (User) ChangePassword ¶
ChangePassword generates a hash based on the new password and saves it to the db.
Click to show internal directories.
Click to hide internal directories.