Documentation ¶ Index ¶ type ID type Repo func (d *Repo) AddUser(ctx context.Context, user User) error func (d *Repo) GetUserByAccount(ctx context.Context, account string) (User, error) func (d *Repo) GetUserByID(ctx context.Context, userID ID) (User, error) func (d *Repo) ListUsers(ctx context.Context) ([]User, error) type User Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type ID ¶ type ID string type Repo ¶ type Repo struct { Pool *pgxpool.Pool } func (*Repo) AddUser ¶ func (d *Repo) AddUser(ctx context.Context, user User) error func (*Repo) GetUserByAccount ¶ func (d *Repo) GetUserByAccount(ctx context.Context, account string) (User, error) func (*Repo) GetUserByID ¶ func (d *Repo) GetUserByID(ctx context.Context, userID ID) (User, error) func (*Repo) ListUsers ¶ func (d *Repo) ListUsers(ctx context.Context) ([]User, error) type User ¶ type User struct { ID ID `json:"id"` Account string `json:"account"` Name string `json:"name"` IsAdmin bool `json:"isAdmin"` IsTeacher bool `json:"isTeacher"` } Source Files ¶ View all Source files repo.go Click to show internal directories. Click to hide internal directories.