db

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Stmts = New()

Functions

This section is empty.

Types

type ChangeUserPasswordParams

type ChangeUserPasswordParams struct {
	ID        uuid.UUID
	UpdatedAt pgtype.Timestamptz
	Password  string
}

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 InsertTokenParams

type InsertTokenParams struct {
	ID              uuid.UUID
	CreatedAt       pgtype.Timestamptz
	Hash            string
	ExpiresAt       pgtype.Timestamptz
	MetaInformation []byte
}

type InsertUserParams

type InsertUserParams struct {
	ID        uuid.UUID
	CreatedAt pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
	Name      string
	Email     string
	Password  string
}

type NullRiverJobState

type NullRiverJobState struct {
	RiverJobState RiverJobState
	Valid         bool // Valid is true if RiverJobState is not NULL
}

func (*NullRiverJobState) Scan

func (ns *NullRiverJobState) Scan(value interface{}) error

Scan implements the Scanner interface.

func (NullRiverJobState) Value

func (ns NullRiverJobState) Value() (driver.Value, error)

Value implements the driver Valuer interface.

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) ChangeUserPassword

func (q *Queries) ChangeUserPassword(ctx context.Context, db DBTX, arg ChangeUserPasswordParams) error

func (*Queries) DeleteExpiredTokens

func (q *Queries) DeleteExpiredTokens(ctx context.Context, db DBTX) error

func (*Queries) DeleteToken

func (q *Queries) DeleteToken(ctx context.Context, db DBTX, id uuid.UUID) error

func (*Queries) DeleteUser

func (q *Queries) DeleteUser(ctx context.Context, db DBTX, id uuid.UUID) error

func (*Queries) InsertToken

func (q *Queries) InsertToken(ctx context.Context, db DBTX, arg InsertTokenParams) (Token, error)

func (*Queries) InsertUser

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

func (*Queries) QueryExpiredTokens

func (q *Queries) QueryExpiredTokens(ctx context.Context, db DBTX) ([]Token, error)

func (*Queries) QueryTokenByHash

func (q *Queries) QueryTokenByHash(ctx context.Context, db DBTX, hash string) (Token, error)

func (*Queries) QueryTokenByID

func (q *Queries) QueryTokenByID(ctx context.Context, db DBTX, id uuid.UUID) (Token, error)

func (*Queries) QueryUserByEmail

func (q *Queries) QueryUserByEmail(ctx context.Context, db DBTX, email string) (User, error)

func (*Queries) QueryUserByID

func (q *Queries) QueryUserByID(ctx context.Context, db DBTX, id uuid.UUID) (User, error)

func (*Queries) QueryUsers

func (q *Queries) QueryUsers(ctx context.Context, db DBTX) ([]User, error)

func (*Queries) QueryValidTokens

func (q *Queries) QueryValidTokens(ctx context.Context, db DBTX) ([]Token, error)

func (*Queries) UpdateTokenExpiresAt

func (q *Queries) UpdateTokenExpiresAt(ctx context.Context, db DBTX, arg UpdateTokenExpiresAtParams) (Token, error)

func (*Queries) UpdateTokenMetaInformation

func (q *Queries) UpdateTokenMetaInformation(ctx context.Context, db DBTX, arg UpdateTokenMetaInformationParams) (Token, error)

func (*Queries) UpdateUser

func (q *Queries) UpdateUser(ctx context.Context, db DBTX, arg UpdateUserParams) (User, error)

func (*Queries) VerifyUserEmail

func (q *Queries) VerifyUserEmail(ctx context.Context, db DBTX, arg VerifyUserEmailParams) error

type RiverJob

type RiverJob struct {
	ID          int64
	State       RiverJobState
	Attempt     int16
	MaxAttempts int16
	AttemptedAt pgtype.Timestamptz
	CreatedAt   pgtype.Timestamptz
	FinalizedAt pgtype.Timestamptz
	ScheduledAt pgtype.Timestamptz
	Priority    int16
	Args        []byte
	AttemptedBy []string
	Errors      [][]byte
	Kind        string
	Metadata    []byte
	Queue       string
	Tags        []string
}

type RiverJobState

type RiverJobState string
const (
	RiverJobStateAvailable RiverJobState = "available"
	RiverJobStateCancelled RiverJobState = "cancelled"
	RiverJobStateCompleted RiverJobState = "completed"
	RiverJobStateDiscarded RiverJobState = "discarded"
	RiverJobStatePending   RiverJobState = "pending"
	RiverJobStateRetryable RiverJobState = "retryable"
	RiverJobStateRunning   RiverJobState = "running"
	RiverJobStateScheduled RiverJobState = "scheduled"
)

func (*RiverJobState) Scan

func (e *RiverJobState) Scan(src interface{}) error

type RiverLeader

type RiverLeader struct {
	ElectedAt pgtype.Timestamptz
	ExpiresAt pgtype.Timestamptz
	LeaderID  string
	Name      string
}

type RiverMigration

type RiverMigration struct {
	ID        int64
	CreatedAt pgtype.Timestamptz
	Version   int64
}

type RiverQueue

type RiverQueue struct {
	Name      string
	CreatedAt pgtype.Timestamptz
	Metadata  []byte
	PausedAt  pgtype.Timestamptz
	UpdatedAt pgtype.Timestamptz
}

type Token

type Token struct {
	ID              uuid.UUID
	CreatedAt       pgtype.Timestamptz
	Hash            string
	ExpiresAt       pgtype.Timestamptz
	MetaInformation []byte
}

type UpdateTokenExpiresAtParams

type UpdateTokenExpiresAtParams struct {
	ID        uuid.UUID
	ExpiresAt pgtype.Timestamptz
}

type UpdateTokenMetaInformationParams

type UpdateTokenMetaInformationParams struct {
	ID              uuid.UUID
	MetaInformation []byte
}

type UpdateUserParams

type UpdateUserParams struct {
	ID        uuid.UUID
	UpdatedAt pgtype.Timestamptz
	Name      string
	Email     string
	Password  string
}

type User

type User struct {
	ID              uuid.UUID
	CreatedAt       pgtype.Timestamptz
	UpdatedAt       pgtype.Timestamptz
	Name            string
	Email           string
	EmailVerifiedAt pgtype.Timestamptz
	Password        string
}

type VerifyUserEmailParams

type VerifyUserEmailParams struct {
	Email           string
	UpdatedAt       pgtype.Timestamptz
	EmailVerifiedAt pgtype.Timestamptz
}

Jump to

Keyboard shortcuts

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