users

package
v0.0.0-...-b83ddff Latest Latest
Warning

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

Go to latest
Published: May 30, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 GetUsersParams

type GetUsersParams struct {
	Search        interface{}
	CreatedAtAsc  bool
	CreatedAtDesc bool
	IDAsc         bool
	IDDesc        bool
	NameAsc       bool
	NameDesc      bool
	OffsetAmount  int32
	LimitAmount   int32
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AddUser

func (q *Queries) AddUser(ctx context.Context, name string) (User, error)

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, id int32) error

func (*Queries) GetUser

func (q *Queries) GetUser(ctx context.Context, id int32) (User, error)

func (*Queries) GetUsers

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

func (*Queries) GetUsersCount

func (q *Queries) GetUsersCount(ctx context.Context, search interface{}) (int64, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID        int32
	Name      string
	CreatedAt pgtype.Timestamptz
}

Jump to

Keyboard shortcuts

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