Documentation ¶
Index ¶
- Constants
- type Repo
- func (r *Repo) Add(ctx context.Context, user user.User) error
- func (r *Repo) Get(ctx context.Context, id data.Id) (*user.User, error)
- func (r *Repo) GetEmail(ctx context.Context, email string) (*user.User, error)
- func (r *Repo) List(ctx context.Context) ([]*user.User, error)
- func (r *Repo) Set(ctx context.Context, user user.User) error
Constants ¶
View Source
const ( //Table is the table we query from to get our user entities. Table = "users" //TableUserClients is the table for our user, client relationships. TableUserClients = "user_clients" )
View Source
const SelectFrom = `SELECT u.id, u.email, u.created_at, u.updated_at, u.enabled FROM ` + Table + ` AS u`
SelectFrom is our select query without filtering, ordering, etc.
View Source
const SelectFromUserClients = `SELECT user_id, client_id FROM ` + TableUserClients
SelectFromUserClients is our select query for user, client relationships.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Repo ¶
type Repo struct {
// contains filtered or unexported fields
}
Repo is a user.Repo implementation that uses a SQL database as its storage.
Click to show internal directories.
Click to hide internal directories.