sqlc

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquireMessagesByTopicParams

type AcquireMessagesByTopicParams struct {
	Topic string      `json:"topic"`
	Limit pgtype.Int4 `json:"limit"`
}

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
	CopyFrom(ctx context.Context, tableName pgx.Identifier, columnNames []string, rowSrc pgx.CopyFromSource) (int64, error)
}

type DeleteExpiredMessagesParams added in v0.2.0

type DeleteExpiredMessagesParams struct {
	Topic  string             `json:"topic"`
	Cutoff pgtype.Timestamptz `json:"cutoff"`
}

type DeleteMessagesByIdsParams

type DeleteMessagesByIdsParams struct {
	Topic string  `json:"topic"`
	Ids   []int64 `json:"ids"`
}

type GetTopicExclusiveStatusRow added in v0.2.0

type GetTopicExclusiveStatusRow struct {
	ExclusiveConsumerID        *uuid.UUID         `json:"exclusive_consumer_id"`
	ExclusiveConsumerExpiresAt pgtype.Timestamptz `json:"exclusive_consumer_expires_at"`
}

type GetTopicForUpdateRow added in v0.2.0

type GetTopicForUpdateRow struct {
	ExclusiveConsumerID        *uuid.UUID         `json:"exclusive_consumer_id"`
	ExclusiveConsumerExpiresAt pgtype.Timestamptz `json:"exclusive_consumer_expires_at"`
}

type InsertMaintenanceLeaseIfAbsentParams added in v0.2.0

type InsertMaintenanceLeaseIfAbsentParams struct {
	Topic    string    `json:"topic"`
	HolderID uuid.UUID `json:"holder_id"`
}

type InsertMessageParams

type InsertMessageParams struct {
	Topic   string `json:"topic"`
	Payload []byte `json:"payload"`
}

type InsertTopicIfAbsentParams added in v0.2.0

type InsertTopicIfAbsentParams struct {
	Topic           string      `json:"topic"`
	ExpirationNanos pgtype.Int8 `json:"expiration_nanos"`
}

type MaintenanceLease added in v0.2.0

type MaintenanceLease struct {
	Topic      string             `json:"topic"`
	HolderID   uuid.UUID          `json:"holder_id"`
	AcquiredAt pgtype.Timestamptz `json:"acquired_at"`
}

type Message

type Message struct {
	ID         int64              `json:"id"`
	InsertedAt pgtype.Timestamptz `json:"inserted_at"`
	Topic      string             `json:"topic"`
	Payload    []byte             `json:"payload"`
}

type Queries

type Queries struct {
}

func New

func New() *Queries

func (*Queries) AcquireMessagesByTopic

func (q *Queries) AcquireMessagesByTopic(ctx context.Context, db DBTX, arg AcquireMessagesByTopicParams) ([]*Message, error)

func (*Queries) DeleteExpiredMessages added in v0.2.0

func (q *Queries) DeleteExpiredMessages(ctx context.Context, db DBTX, arg DeleteExpiredMessagesParams) error

func (*Queries) DeleteMessagesByIds

func (q *Queries) DeleteMessagesByIds(ctx context.Context, db DBTX, arg DeleteMessagesByIdsParams) error

func (*Queries) GetAllTopics added in v0.2.0

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

func (*Queries) GetOldestMessageInsertedAt added in v0.2.0

func (q *Queries) GetOldestMessageInsertedAt(ctx context.Context, db DBTX, topic string) (pgtype.Timestamptz, error)

func (*Queries) GetTopicExclusiveStatus added in v0.2.0

func (q *Queries) GetTopicExclusiveStatus(ctx context.Context, db DBTX, topic string) (*GetTopicExclusiveStatusRow, error)

func (*Queries) GetTopicForUpdate added in v0.2.0

func (q *Queries) GetTopicForUpdate(ctx context.Context, db DBTX, topic string) (*GetTopicForUpdateRow, error)

func (*Queries) GetTopicsWithExpiration added in v0.2.0

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

func (*Queries) InsertMaintenanceLeaseIfAbsent added in v0.2.0

func (q *Queries) InsertMaintenanceLeaseIfAbsent(ctx context.Context, db DBTX, arg InsertMaintenanceLeaseIfAbsentParams) error

func (*Queries) InsertMessage

func (q *Queries) InsertMessage(ctx context.Context, db DBTX, arg []InsertMessageParams) (int64, error)

func (*Queries) InsertTopicIfAbsent added in v0.2.0

func (q *Queries) InsertTopicIfAbsent(ctx context.Context, db DBTX, arg InsertTopicIfAbsentParams) error

func (*Queries) RenewTopicExclusiveConsumer added in v0.2.0

func (q *Queries) RenewTopicExclusiveConsumer(ctx context.Context, db DBTX, arg RenewTopicExclusiveConsumerParams) error

func (*Queries) SelectMaintenanceLeaseForUpdate added in v0.2.0

func (q *Queries) SelectMaintenanceLeaseForUpdate(ctx context.Context, db DBTX, topic string) (*SelectMaintenanceLeaseForUpdateRow, error)

func (*Queries) SetTopicExclusiveConsumer added in v0.2.0

func (q *Queries) SetTopicExclusiveConsumer(ctx context.Context, db DBTX, arg SetTopicExclusiveConsumerParams) error

func (*Queries) UpdateMaintenanceLease added in v0.2.0

func (q *Queries) UpdateMaintenanceLease(ctx context.Context, db DBTX, arg UpdateMaintenanceLeaseParams) error

type RenewTopicExclusiveConsumerParams added in v0.2.0

type RenewTopicExclusiveConsumerParams struct {
	Topic                      string             `json:"topic"`
	ExclusiveConsumerID        *uuid.UUID         `json:"exclusive_consumer_id"`
	ExclusiveConsumerExpiresAt pgtype.Timestamptz `json:"exclusive_consumer_expires_at"`
}

type SelectMaintenanceLeaseForUpdateRow added in v0.2.0

type SelectMaintenanceLeaseForUpdateRow struct {
	HolderID   uuid.UUID          `json:"holder_id"`
	AcquiredAt pgtype.Timestamptz `json:"acquired_at"`
}

type SetTopicExclusiveConsumerParams added in v0.2.0

type SetTopicExclusiveConsumerParams struct {
	Topic                      string             `json:"topic"`
	ExclusiveConsumerID        *uuid.UUID         `json:"exclusive_consumer_id"`
	ExclusiveConsumerExpiresAt pgtype.Timestamptz `json:"exclusive_consumer_expires_at"`
}

type Topic added in v0.2.0

type Topic struct {
	Topic                      string             `json:"topic"`
	ExpirationNanos            pgtype.Int8        `json:"expiration_nanos"`
	ExclusiveConsumerID        *uuid.UUID         `json:"exclusive_consumer_id"`
	ExclusiveConsumerExpiresAt pgtype.Timestamptz `json:"exclusive_consumer_expires_at"`
}

type UpdateMaintenanceLeaseParams added in v0.2.0

type UpdateMaintenanceLeaseParams struct {
	Topic    string    `json:"topic"`
	HolderID uuid.UUID `json:"holder_id"`
}

Jump to

Keyboard shortcuts

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