Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dataddo/pgq
/ functions
Functions
122 in github.com/dataddo/pgq
⨍
Functions
122
◇
Types & classes
36
↓ 73 callers
Function
NoError
NoError fails the test if err is not nil.
internal/require/require.go:11
↓ 34 callers
Method
WriteString
WriteString appends the provided string to the query and extracts any parameters from it.
internal/query/query_builder.go:24
↓ 31 callers
Method
ExecContext
(ctx context.Context, query string, args ...interface{})
consumer.go:712
↓ 22 callers
Function
Equal
Equal fails the test if expected is not equal to actual.
internal/require/require.go:35
↓ 20 callers
Method
String
()
internal/query/query_builder.go:42
↓ 18 callers
Function
QuoteIdentifier
QuoteIdentifier quotes an "identifier" (e.g. a table or a column name) to be used as part of an SQL statement. For example: tblname := "my_table"
internal/pg/pg.go:33
↓ 13 callers
Function
openDB
(t *testing.T)
integtest/consumer_test.go:324
↓ 12 callers
Method
Run
Run consumes messages until the context isn't cancelled.
consumer.go:318
↓ 10 callers
Function
GenerateDropTableQuery
GenerateDropTableQuery returns a postgres query for dropping the queue table
x/schema/queue.go:34
↓ 9 callers
Method
Publish
(ctx context.Context, queue string, msg ...*MessageOutgoing)
publisher.go:25
↓ 8 callers
Function
NewPublisher
NewPublisher initializes the publisher with given *sql.DB client.
publisher.go:54
↓ 7 callers
Function
NewConsumer
NewConsumer creates Consumer with proper settings
consumer.go:264
↓ 7 callers
Method
Next
Next returns next parameter.
internal/pg/pg.go:15
↓ 6 callers
Method
Error
()
errors.go:22
↓ 6 callers
Method
Fatal
()
errors.go:23
↓ 6 callers
Function
generateDropTableQuery
(queueName string)
validator_test.go:263
↓ 6 callers
Function
generateRandomString
(length int)
validator_test.go:183
↓ 6 callers
Function
openDB
TODO: This was recovered from the consumer_test.go file. We can make a common testing package and add all these common functionalities will be include
validator_test.go:155
↓ 5 callers
Function
ErrorIs
ErrorIs fails the test if err is nil or does not match target.
internal/require/require.go:27
↓ 5 callers
Function
GenerateCreateTableQuery
GenerateCreateTableQuery returns the query for creating the queue table
x/schema/queue.go:11
↓ 5 callers
Function
WithInvalidMessageCallback
WithInvalidMessageCallback sets callback for invalid messages.
consumer.go:196
↓ 5 callers
Function
WithLockDuration
WithLockDuration sets the maximal duration for how long the message remains locked for other consumers.
consumer.go:151
↓ 5 callers
Function
WithLogger
WithLogger sets logger. Default is no logging.
consumer.go:223
↓ 5 callers
Function
WithMaxParallelMessages
WithMaxParallelMessages sets how many jobs can single consumer process simultaneously.
consumer.go:175
↓ 5 callers
Function
WithMetrics
WithMetrics sets metrics meter. Default is noop.Meter{}.
consumer.go:182
↓ 5 callers
Function
WithPollingInterval
WithPollingInterval sets how frequently consumer checks the queue for new messages.
consumer.go:159
↓ 5 callers
Function
acquireMaxFromSemaphore
acquireMaxFromSemaphore acquires maximum possible weight. It blocks until resources are available or ctx is done. On success, returns acquired weight.
consumer.go:794
↓ 4 callers
Function
Error
Error fails the test if err is nil.
internal/require/require.go:19
↓ 4 callers
Method
SetDeadline
SetDeadline sets the message deadline. If the deadline is after the message deadline, it returns ErrInvalidDeadline. The timeout also affects the queu
message.go:129
↓ 4 callers
Function
ValidateFields
ValidateFields checks if required fields exist
validator.go:55
↓ 4 callers
Function
ValidateIndexes
ValidateIndexes checks if required indexes exist
validator.go:91
↓ 4 callers
Function
WithHistoryLimit
WithHistoryLimit sets how long in history you want to search for unprocessed messages (default is no limit). If not set, it will look for message in t
consumer.go:206
↓ 3 callers
Function
StaticMetaInjector
StaticMetaInjector returns a Metadata injector that injects given Metadata.
publisher.go:46
↓ 3 callers
Function
WithMetaInjectors
WithMetaInjectors adds Metadata injectors to the publisher. Injectors are run in the order they are given.
publisher.go:39
↓ 3 callers
Function
WithMetadataFilter
(filter *MetadataFilter)
consumer.go:252
↓ 3 callers
Function
isErrorCode
var ( _ pgError = (*pgconn.PgError)(nil) _ pgError = (*pq.Error)(nil) _ legacyPGError = (*pq.Error)(nil) )
errors.go:33
↓ 2 callers
Method
Get
(k byte)
errors.go:24
↓ 2 callers
Method
HasParam
HasParam checks whether the Builder has a parameter of the given name.
internal/query/query_builder.go:33
↓ 2 callers
Method
buildArgs
(ctx context.Context, msgs []*MessageOutgoing)
publisher.go:141
↓ 2 callers
Function
buildInsertQuery
(queue string, msgCount int)
publisher.go:117
↓ 2 callers
Method
discardMessage
(exec execer, msgID pgtype.UUID)
consumer.go:759
↓ 2 callers
Function
generateCreateTableQuery
(queueName string)
validator_test.go:205
↓ 2 callers
Function
generateInvalidQueueQuery
(queueName string)
validator_test.go:192
↓ 2 callers
Method
generateQuery
()
consumer.go:375
↓ 2 callers
Function
getParams
getParams extracts tags formatted as :tagName from the provided line, ignoring type casting patterns like ::interval.
internal/query/query_builder.go:61
↓ 2 callers
Function
isJSONObject
(b json.RawMessage)
consumer.go:702
↓ 2 callers
Function
prepareCtxTimeout
()
consumer.go:477
↓ 1 callers
Method
Build
Build returns the query string with the parameters replaced by the values from the provided map.
internal/query/query_builder.go:47
↓ 1 callers
Method
HandleMessage
(context.Context, *MessageIncoming)
consumer.go:66
↓ 1 callers
Method
LastAttempt
LastAttempt returns true if the message is consumed for the last time according to maxConsumedCount settings. If the Consumer is not configured to lim
message.go:105
↓ 1 callers
Function
NewBuilder
()
internal/query/query_builder.go:19
↓ 1 callers
Function
NewConsumerExt
NewConsumer creates Consumer with proper settings, using sqlx.DB (until refactored to use pgx directly)
consumer.go:269
↓ 1 callers
Function
NewPublisherExt
NewPublisher initializes the publisher with given *sqlx.DB client
publisher.go:59
↓ 1 callers
Method
SQLState
()
errors.go:15
↓ 1 callers
Function
WithAckTimeout
WithAckTimeout sets the timeout for updating the message status when message is processed.
consumer.go:167
↓ 1 callers
Function
WithMaxConsumeCount
WithMaxConsumeCount sets the maximal number of times a message can be consumed before it is ignored. Unhandled SIGKILL or uncaught panic, OOM error et
consumer.go:216
↓ 1 callers
Function
WithMessageProcessingReserveDuration
WithMessageProcessingReserveDuration sets the duration for which the message is reserved for handling result state.
consumer.go:189
↓ 1 callers
Method
ack
ack positively acknowledges the message, and the message is marked as processed.
message.go:149
↓ 1 callers
Method
ackMessage
(exec execer, msgID pgtype.UUID)
consumer.go:715
↓ 1 callers
Function
buildColumnListFromTags
buildColumnListFromTags dynamically constructs a list of column names based on the `db` struct tags of any given struct. It returns a slice of strings
message.go:183
↓ 1 callers
Function
checkIndexData
(ctx context.Context, db *sqlx.DB, queueName string)
validator.go:125
↓ 1 callers
Method
consumeMessages
(ctx context.Context, query *query.Builder)
consumer.go:487
↓ 1 callers
Method
discard
discard removes the message from the queue completely. It's like ack, but it also records the reason why the message was discarded.
message.go:171
↓ 1 callers
Method
discardInvalidMsg
(ctx context.Context, id pgtype.UUID, err error)
consumer.go:639
↓ 1 callers
Function
ensureUUIDExtension
(t *testing.T, db *sqlx.DB)
validator_test.go:170
↓ 1 callers
Function
ensureUUIDExtension
(t *testing.T, db *sql.DB)
integtest/consumer_test.go:339
↓ 1 callers
Method
finishParsing
(pgMsg pgMessage)
consumer.go:654
↓ 1 callers
Function
generateCreateTablePartitionedQuery
(queueName string)
validator_test.go:243
↓ 1 callers
Function
generateCreateTableQueryCompositeIndex
(queueName string)
validator_test.go:224
↓ 1 callers
Function
getColumnData
(ctx context.Context, db *sqlx.DB, queueName string)
validator.go:104
↓ 1 callers
Method
handleMessage
(ctx context.Context, msg *MessageIncoming)
consumer.go:417
↓ 1 callers
Method
logFields
(msg pgMessage, err error)
consumer.go:625
↓ 1 callers
Method
nack
nack does not the negative acknowledge of the message. The message is returned to the queue after nack and may be processed again.
message.go:160
↓ 1 callers
Method
nackMessage
(exec execer, msgID pgtype.UUID)
consumer.go:737
↓ 1 callers
Function
parseMetadata
(pgMsg pgMessage)
consumer.go:688
↓ 1 callers
Function
parsePayload
(pgMsg pgMessage)
consumer.go:678
↓ 1 callers
Method
parseRow
(ctx context.Context, rows *sqlx.Rows)
consumer.go:597
↓ 1 callers
Function
prepareProcessMetric
(queueName string, meter metric.Meter)
consumer.go:294
↓ 1 callers
Method
tryConsumeMessages
(ctx context.Context, query *query.Builder, limit int64)
consumer.go:523
↓ 1 callers
Method
updateLockedUntil
(db *sqlx.DB, id pgtype.UUID)
consumer.go:781
↓ 1 callers
Method
verifyTable
(ctx context.Context)
consumer.go:357
Method
Error
()
consumer.go:37
Method
Error
()
errors_test.go:15
Method
Error
()
errors_test.go:31
Function
ExampleConsumer
()
example_consumer_test.go:50
Function
ExampleNewConsumer
()
examples_test.go:16
Function
ExampleNewPublisher
()
examples_test.go:39
Function
ExamplePublisher
()
example_publisher_test.go:17
Method
Fatal
()
errors_test.go:19
Method
Get
(k byte)
errors_test.go:23
Method
HandleMessage
HandleMessage calls self. It also implements MessageHandler interface.
consumer.go:73
Method
HandleMessage
(ctx context.Context, msg *pgq.MessageIncoming)
example_consumer_test.go:18
Method
HandleMessage
(ctx context.Context, _ *MessageIncoming)
integtest/consumer_test.go:357
Method
HandleMessage
(ctx context.Context, _ *MessageIncoming)
integtest/consumer_test.go:362
Function
NewMessage
NewMessage creates new message that satisfies Message interface.
message.go:55
Method
Publish
Publish publishes the message.
publisher.go:68
Method
SQLState
()
errors_test.go:35
Method
SetTimeout
SetTimeout sets the message timeout. If the timeout is after the message deadline, it returns ErrInvalidDeadline. The timeout also affects the queue l
message.go:117
Function
TestAcquireMaxFromSemaphore
(t *testing.T)
consumer_test.go:93
Function
TestClient_buildArgs
(t *testing.T)
publisher_test.go:48
next →
1–100 of 122, ranked by callers