postgres

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 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 GetJobLockRow

type GetJobLockRow struct {
	Holder    string
	Touched   pgtype.Timestamptz
	Iteration int64
}

type InsertJobLockParams

type InsertJobLockParams struct {
	Name   string
	Holder string
}

type JobLock

type JobLock struct {
	Name      string
	Holder    string
	Touched   pgtype.Timestamptz
	Iteration int64
}

type NotifyParams

type NotifyParams struct {
	Channel string
	Message string
}

type PingJobLockParams

type PingJobLockParams struct {
	Name      string
	Holder    string
	Iteration int64
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) AcquireTXLock

func (q *Queries) AcquireTXLock(ctx context.Context, id int64) error

func (*Queries) GetJobLock

func (q *Queries) GetJobLock(ctx context.Context, name string) (GetJobLockRow, error)

func (*Queries) InsertJobLock

func (q *Queries) InsertJobLock(ctx context.Context, arg InsertJobLockParams) (int64, error)

func (*Queries) Notify

func (q *Queries) Notify(ctx context.Context, arg NotifyParams) error

func (*Queries) PingJobLock

func (q *Queries) PingJobLock(ctx context.Context, arg PingJobLockParams) (int64, error)

func (*Queries) ReleaseJobLock

func (q *Queries) ReleaseJobLock(ctx context.Context, arg ReleaseJobLockParams) (int64, error)

func (*Queries) StealJobLock

func (q *Queries) StealJobLock(ctx context.Context, arg StealJobLockParams) (int64, error)

func (*Queries) WithTx

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

type ReleaseJobLockParams

type ReleaseJobLockParams struct {
	Name   string
	Holder string
}

type StealJobLockParams

type StealJobLockParams struct {
	NewHolder      string
	Name           string
	PreviousHolder string
	Iteration      int64
}

Jump to

Keyboard shortcuts

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