Documentation ¶
Index ¶
- type CreateUserParams
- type DBTX
- type GenerateSessionParams
- type Querier
- type Queries
- func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
- func (q *Queries) GenerateSession(ctx context.Context, arg GenerateSessionParams) (Session, error)
- func (q *Queries) GetSession(ctx context.Context, userIDSession int64) (Session, error)
- func (q *Queries) GetUserById(ctx context.Context, userID int64) (User, error)
- func (q *Queries) GetUserBySocialId(ctx context.Context, socialID string) (User, error)
- func (q *Queries) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
- type SQLCStore
- type Session
- type UpdateUserParams
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateUserParams ¶
type GenerateSessionParams ¶
type Querier ¶
type Querier interface { CreateUser(ctx context.Context, arg CreateUserParams) (User, error) GenerateSession(ctx context.Context, arg GenerateSessionParams) (Session, error) GetSession(ctx context.Context, userIDSession int64) (Session, error) GetUserById(ctx context.Context, userID int64) (User, error) GetUserBySocialId(ctx context.Context, socialID string) (User, error) UpdateUser(ctx context.Context, arg UpdateUserParams) (User, error) }
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateUser ¶
func (*Queries) GenerateSession ¶
func (*Queries) GetSession ¶
func (*Queries) GetUserById ¶
func (*Queries) GetUserBySocialId ¶
func (*Queries) UpdateUser ¶
type SQLCStore ¶
type SQLCStore struct { *Queries // contains filtered or unexported fields }
SQLCStore provides all functions to execute db queries and transactions ----> IMPORTANT : we implement store to re-use neccesary code for transactions
type UpdateUserParams ¶
type User ¶
type User struct { UserID int64 `json:"user_id"` // this field is for the unique id provided by google, or facebook, or tik tok etc etc.. to identify a user SocialID string `json:"social_id"` Username string `json:"username"` Email string `json:"email"` Picture string `json:"picture"` Provider string `json:"provider"` RegisteredAt time.Time `json:"registered_at"` }
primary key is composed by user_id and social_id, both of those properties are unique
Click to show internal directories.
Click to hide internal directories.