Documentation ¶
Index ¶
- type Store
- type TeamRepository
- type UserRepository
- func (r *UserRepository) Delete(id int) error
- func (r *UserRepository) Get(id int) (auth.User, error)
- func (r *UserRepository) GetByEmail(email string) (auth.User, error)
- func (r *UserRepository) List() ([]auth.User, error)
- func (r *UserRepository) PaperOwner(paperID int) (int, error)
- func (r *UserRepository) Upsert(user *auth.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type TeamRepository ¶
type TeamRepository struct {
// contains filtered or unexported fields
}
func NewTeamRepository ¶
func NewTeamRepository(store *Store) *TeamRepository
NewUserRepository creates a new user repository based on a store.
func (*TeamRepository) Delete ¶
func (r *TeamRepository) Delete(id int) error
func (*TeamRepository) GetForUser ¶
func (r *TeamRepository) GetForUser(userID int) ([]auth.Team, error)
type UserRepository ¶
type UserRepository struct {
// contains filtered or unexported fields
}
func NewUserRepository ¶
func NewUserRepository(store *Store) *UserRepository
NewUserRepository creates a new user repository based on a store.
func (*UserRepository) Delete ¶
func (r *UserRepository) Delete(id int) error
Delete removes a user from the database based on its id.
func (*UserRepository) Get ¶
func (r *UserRepository) Get(id int) (auth.User, error)
Get retrieves a user from its id.
func (*UserRepository) GetByEmail ¶
func (r *UserRepository) GetByEmail(email string) (auth.User, error)
func (*UserRepository) List ¶
func (r *UserRepository) List() ([]auth.User, error)
List returns all the user in the database
func (*UserRepository) PaperOwner ¶
func (r *UserRepository) PaperOwner(paperID int) (int, error)
PaperOwner retrieves for a paper defined by its id the user id of the owner of that paper. This supposes that there is only one owner for a given paper. It is the responsibility of the caller to ensure that by checking if a paper already has an owner before adding a new link (for now).
Click to show internal directories.
Click to hide internal directories.