Documentation ¶
Index ¶
- Variables
- type Repository
- func (r *Repository) All() ([]User, error)
- func (r *Repository) Create(user *User, passwd string) (*User, error)
- func (r *Repository) Delete(id int64) error
- func (r *Repository) GetByEmail(email string) (*User, error)
- func (r *Repository) GetByID(id int64) (*User, error)
- func (r *Repository) Migrate() error
- func (r *Repository) Update(id int64, updated User) (*User, error)
- type User
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(db *sql.DB) *Repository
func (*Repository) All ¶
func (r *Repository) All() ([]User, error)
func (*Repository) Delete ¶
func (r *Repository) Delete(id int64) error
func (*Repository) GetByEmail ¶
func (r *Repository) GetByEmail(email string) (*User, error)
func (*Repository) Migrate ¶
func (r *Repository) Migrate() error
FIXME: Using serial number as an id can leak information about the user. Don't do this in production.
Click to show internal directories.
Click to hide internal directories.