queries

package
v0.0.0-...-b8d8853 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKey

type ApiKey struct {
	ID        string
	UserID    string
	Key       string
	CreatedAt sql.NullTime
	DeletedAt sql.NullTime
}

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type DeleteApiKeyParams

type DeleteApiKeyParams struct {
	UserID string
	Key    string
}

type InsertApiKeyParams

type InsertApiKeyParams struct {
	UserID string
	Key    string
}

type InsertUserParams

type InsertUserParams struct {
	Email     string
	EmailHash string
	Password  string
	FirstName sql.NullString
	LastName  sql.NullString
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) ApiKeyExists

func (q *Queries) ApiKeyExists(ctx context.Context, key string) (bool, error)

func (*Queries) DeleteApiKey

func (q *Queries) DeleteApiKey(ctx context.Context, arg DeleteApiKeyParams) error

func (*Queries) FindByApiKey

func (q *Queries) FindByApiKey(ctx context.Context, key string) (ApiKey, error)

func (*Queries) FindByEmail

func (q *Queries) FindByEmail(ctx context.Context, emailHash string) (User, error)

func (*Queries) FindByUserId

func (q *Queries) FindByUserId(ctx context.Context, userID string) ([]ApiKey, error)

func (*Queries) InsertApiKey

func (q *Queries) InsertApiKey(ctx context.Context, arg InsertApiKeyParams) (string, error)

func (*Queries) InsertUser

func (q *Queries) InsertUser(ctx context.Context, arg InsertUserParams) error

func (*Queries) UpdateVerifiedAt

func (q *Queries) UpdateVerifiedAt(ctx context.Context, emailHash string) error

func (*Queries) UserExists

func (q *Queries) UserExists(ctx context.Context, id string) (bool, error)

func (*Queries) WithTx

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

type User

type User struct {
	ID              string
	FirstName       sql.NullString
	LastName        sql.NullString
	Email           string
	EmailHash       string
	EmailVerifiedAt sql.NullTime
	Password        string
	CreatedAt       sql.NullTime
	UpdatedAt       sql.NullTime
	DeletedAt       sql.NullTime
}

Jump to

Keyboard shortcuts

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