repository

package
v0.0.0-...-281d3a1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateUserParams

type CreateUserParams struct {
	Firstname    string      `json:"firstname"`
	Othernames   string      `json:"othernames"`
	Email        string      `json:"email"`
	Organization pgtype.Text `json:"organization"`
	Role         pgtype.Text `json:"role"`
	Phone        pgtype.Text `json:"phone"`
	SshKey       pgtype.Text `json:"ssh_key"`
}

type DBTX

type DBTX interface {
	Exec(context.Context, string, ...interface{}) (pgconn.CommandTag, error)
	Query(context.Context, string, ...interface{}) (pgx.Rows, error)
	QueryRow(context.Context, string, ...interface{}) pgx.Row
}

type GetAllUsersParams

type GetAllUsersParams struct {
	Limit  int32 `json:"limit"`
	Offset int32 `json:"offset"`
}

type Queries

type Queries struct {
	// contains filtered or unexported fields
}

func New

func New(db DBTX) *Queries

func (*Queries) CreateUser

func (q *Queries) CreateUser(ctx context.Context, arg CreateUserParams) (User, error)

func (*Queries) GetAllUsers

func (q *Queries) GetAllUsers(ctx context.Context, arg GetAllUsersParams) ([]User, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx pgx.Tx) *Queries

type User

type User struct {
	ID           uuid.UUID   `json:"id"`
	Firstname    string      `json:"firstname"`
	Othernames   string      `json:"othernames"`
	Email        string      `json:"email"`
	Organization pgtype.Text `json:"organization"`
	Role         pgtype.Text `json:"role"`
	Phone        pgtype.Text `json:"phone"`
	SshKey       pgtype.Text `json:"ssh_key"`
	CreatedAt    time.Time   `json:"created_at"`
	UpdatedAt    time.Time   `json:"updated_at"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL