{"modulePath":"github.com/uber/submitqueue","version":"v0.2.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package mysql\n\nPackage mysql is a generated GoMock package.\n\n## Constants\n\n```go\nconst (\n\t// Fixed table names for single-table design\n\tMessagesTableName             = \"queue_messages\"\n\tPartitionLeasesTableName      = \"queue_partition_leases\"\n\tOffsetsTableName              = \"queue_offsets\"\n\tSubscriberHeartbeatsTableName = \"queue_subscriber_heartbeats\"\n\tDeliveryStateTableName        = \"queue_delivery_state\"\n)\n```\n\n## Variables\n\n```go\nvar ErrPublisherClosed = errors.New(\"publisher is closed\")\n```\nErrPublisherClosed is returned when attempting to publish after the publisher has been closed. This is a graceful error, not a programming bug — concurrent goroutines may still hold references to the publisher when Close() is called, and their subsequent Publish calls return this error to signal they should stop.\n\n```go\nvar ErrSubscriberClosed = errors.New(\"subscriber is closed\")\n```\nErrSubscriberClosed is returned when attempting to subscribe after the subscriber has been closed.\n\n## Functions\n\n```go\nfunc NewPublisher(logger *zap.SugaredLogger, scope tally.Scope, messageStore messageStore) *publisher\n```\nNewPublisher creates a publisher with the given dependencies\n\n```go\nfunc NewQueue(params Params) (extqueue.Queue, error)\n```\nNewQueue creates a new SQL-based queue\n\n```go\nfunc NewSubscriber(logger *zap.SugaredLogger, scope tally.Scope, messageStore messageStore, offsetStore offsetStore, leaseStore partitionLeaseStore, heartbeatStore subscriberHeartbeatStore, deliveryStateStore deliveryStateStore) *subscriber\n```\n\n## Types\n\n```go\ntype DeliveryState struct {\n\t// Acked indicates whether this consumer group has processed the message\n\tAcked bool\n\t// InvisibleUntil is the epoch milliseconds until which the message is hidden\n\tInvisibleUntil int64\n\t// RetryCount tracks how many times the message has been delivered\n\tRetryCount int\n}\n```\nDeliveryState represents the full per-message delivery tracking state.\n\n```go\ntype ErrAlreadyAcknowledged struct {\n\tDeliveryID string\n}\n```\nErrAlreadyAcknowledged is returned when attempting to ack/nack a delivery that was already processed\n\n```go\nfunc (e *ErrAlreadyAcknowledged) Error() string\n```\n\n```go\ntype ErrLeaseExpired struct {\n\t// Topic is the topic the lease was for.\n\tTopic string\n\t// PartitionKey is the partition the lease was for.\n\tPartitionKey string\n}\n```\nErrLeaseExpired is returned when a lease renewal fails because the lease is no longer owned by this worker (rows affected == 0).\n\n```go\nfunc (e *ErrLeaseExpired) Error() string\n```\n\n```go\ntype HookSignal int\n```\nHookSignal identifies the type of subscriber lifecycle event. Named after behavioral concerns (what happened) rather than implementation details (which loop ran), so signal names remain stable across refactors.\n\n```go\nconst (\n\t// SignalDeliveryCheck is sent after the subscriber checks a partition for\n\t// deliverable messages (including watermark advancement).\n\tSignalDeliveryCheck HookSignal = iota\n\n\t// SignalPartitionUpdate is sent after the subscriber evaluates partition\n\t// ownership (discovery, rebalance, lease renewal, heartbeat).\n\tSignalPartitionUpdate\n)\n```\n\n```go\ntype MockdeliveryStateStore struct {\n\t// contains filtered or unexported fields\n}\n```\nMockdeliveryStateStore is a mock of deliveryStateStore interface.\n\n```go\nfunc NewMockdeliveryStateStore(ctrl *gomock.Controller) *MockdeliveryStateStore\n```\nNewMockdeliveryStateStore creates a new mock instance.\n\n```go\nfunc (m *MockdeliveryStateStore) AdvanceWatermark(ctx context.Context, consumerGroup, topic, partitionKey string, currentWatermark int64, offsets []int64) (int64, error)\n```\nAdvanceWatermark mocks base method.\n\n```go\nfunc (m *MockdeliveryStateStore) EXPECT() *MockdeliveryStateStoreMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockdeliveryStateStore) ExtendVisibility(ctx context.Context, consumerGroup, topic, partitionKey string, offset, visibilityTimeoutMs int64) error\n```\nExtendVisibility mocks base method.\n\n```go\nfunc (m *MockdeliveryStateStore) GetDeliveryState(ctx context.Context, consumerGroup, topic, partitionKey string, offset int64) (DeliveryState, bool, error)\n```\nGetDeliveryState mocks base method.\n\n```go\nfunc (m *MockdeliveryStateStore) MarkAcked(ctx context.Context, consumerGroup, topic, partitionKey string, offset int64) error\n```\nMarkAcked mocks base method.\n\n```go\nfunc (m *MockdeliveryStateStore) MarkDelivered(ctx context.Context, consumerGroup, topic, partitionKey string, offset, visibilityTimeoutMs int64) (int, error)\n```\nMarkDelivered mocks base method.\n\n```go\nfunc (m *MockdeliveryStateStore) MarkNacked(ctx context.Context, consumerGroup, topic, partitionKey string, offset, delayMs int64) error\n```\nMarkNacked mocks base method.\n\n```go\ntype MockdeliveryStateStoreMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockdeliveryStateStoreMockRecorder is the mock recorder for MockdeliveryStateStore.\n\n```go\nfunc (mr *MockdeliveryStateStoreMockRecorder) AdvanceWatermark(ctx, consumerGroup, topic, partitionKey, currentWatermark, offsets any) *gomock.Call\n```\nAdvanceWatermark indicates an expected call of AdvanceWatermark.\n\n```go\nfunc (mr *MockdeliveryStateStoreMockRecorder) ExtendVisibility(ctx, consumerGroup, topic, partitionKey, offset, visibilityTimeoutMs any) *gomock.Call\n```\nExtendVisibility indicates an expected call of ExtendVisibility.\n\n```go\nfunc (mr *MockdeliveryStateStoreMockRecorder) GetDeliveryState(ctx, consumerGroup, topic, partitionKey, offset any) *gomock.Call\n```\nGetDeliveryState indicates an expected call of GetDeliveryState.\n\n```go\nfunc (mr *MockdeliveryStateStoreMockRecorder) MarkAcked(ctx, consumerGroup, topic, partitionKey, offset any) *gomock.Call\n```\nMarkAcked indicates an expected call of MarkAcked.\n\n```go\nfunc (mr *MockdeliveryStateStoreMockRecorder) MarkDelivered(ctx, consumerGroup, topic, partitionKey, offset, visibilityTimeoutMs any) *gomock.Call\n```\nMarkDelivered indicates an expected call of MarkDelivered.\n\n```go\nfunc (mr *MockdeliveryStateStoreMockRecorder) MarkNacked(ctx, consumerGroup, topic, partitionKey, offset, delayMs any) *gomock.Call\n```\nMarkNacked indicates an expected call of MarkNacked.\n\n```go\ntype MockmessageStore struct {\n\t// contains filtered or unexported fields\n}\n```\nMockmessageStore is a mock of messageStore interface.\n\n```go\nfunc NewMockmessageStore(ctrl *gomock.Controller) *MockmessageStore\n```\nNewMockmessageStore creates a new mock instance.\n\n```go\nfunc (m *MockmessageStore) Delete(ctx context.Context, topic, partitionKey, messageID string) error\n```\nDelete mocks base method.\n\n```go\nfunc (m *MockmessageStore) EXPECT() *MockmessageStoreMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockmessageStore) FetchByOffset(ctx context.Context, topic, partitionKey string, currentOffset, nowMs int64, limit int) ([]messageRow, error)\n```\nFetchByOffset mocks base method.\n\n```go\nfunc (m *MockmessageStore) GarbageCollect(ctx context.Context, topic, partitionKey string, minAckedOffset int64) (int64, error)\n```\nGarbageCollect mocks base method.\n\n```go\nfunc (m *MockmessageStore) GetOffsetsAbove(ctx context.Context, topic, partitionKey string, afterOffset int64, limit int) ([]int64, error)\n```\nGetOffsetsAbove mocks base method.\n\n```go\nfunc (m *MockmessageStore) Insert(ctx context.Context, topic string, messages []messagequeue.Message) error\n```\nInsert mocks base method.\n\n```go\nfunc (m *MockmessageStore) InsertDelayed(ctx context.Context, topic string, messages []messagequeue.Message, visibleAfterMs int64) error\n```\nInsertDelayed mocks base method.\n\n```go\nfunc (m *MockmessageStore) MoveToDLQ(ctx context.Context, topic, partitionKey, messageID string, failureCount int, lastError, dlqTopicSuffix string) error\n```\nMoveToDLQ mocks base method.\n\n```go\ntype MockmessageStoreMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockmessageStoreMockRecorder is the mock recorder for MockmessageStore.\n\n```go\nfunc (mr *MockmessageStoreMockRecorder) Delete(ctx, topic, partitionKey, messageID any) *gomock.Call\n```\nDelete indicates an expected call of Delete.\n\n```go\nfunc (mr *MockmessageStoreMockRecorder) FetchByOffset(ctx, topic, partitionKey, currentOffset, nowMs, limit any) *gomock.Call\n```\nFetchByOffset indicates an expected call of FetchByOffset.\n\n```go\nfunc (mr *MockmessageStoreMockRecorder) GarbageCollect(ctx, topic, partitionKey, minAckedOffset any) *gomock.Call\n```\nGarbageCollect indicates an expected call of GarbageCollect.\n\n```go\nfunc (mr *MockmessageStoreMockRecorder) GetOffsetsAbove(ctx, topic, partitionKey, afterOffset, limit any) *gomock.Call\n```\nGetOffsetsAbove indicates an expected call of GetOffsetsAbove.\n\n```go\nfunc (mr *MockmessageStoreMockRecorder) Insert(ctx, topic, messages any) *gomock.Call\n```\nInsert indicates an expected call of Insert.\n\n```go\nfunc (mr *MockmessageStoreMockRecorder) InsertDelayed(ctx, topic, messages, visibleAfterMs any) *gomock.Call\n```\nInsertDelayed indicates an expected call of InsertDelayed.\n\n```go\nfunc (mr *MockmessageStoreMockRecorder) MoveToDLQ(ctx, topic, partitionKey, messageID, failureCount, lastError, dlqTopicSuffix any) *gomock.Call\n```\nMoveToDLQ indicates an expected call of MoveToDLQ.\n\n```go\ntype MockoffsetStore struct {\n\t// contains filtered or unexported fields\n}\n```\nMockoffsetStore is a mock of offsetStore interface.\n\n```go\nfunc NewMockoffsetStore(ctrl *gomock.Controller) *MockoffsetStore\n```\nNewMockoffsetStore creates a new mock instance.\n\n```go\nfunc (m *MockoffsetStore) EXPECT() *MockoffsetStoreMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockoffsetStore) GetAckedOffset(ctx context.Context, topic, partitionKey, consumerGroup string) (int64, error)\n```\nGetAckedOffset mocks base method.\n\n```go\nfunc (m *MockoffsetStore) GetMinAckedOffset(ctx context.Context, topic, partitionKey string) (int64, bool, error)\n```\nGetMinAckedOffset mocks base method.\n\n```go\nfunc (m *MockoffsetStore) Initialize(ctx context.Context, topic, partitionKey, consumerGroup string) error\n```\nInitialize mocks base method.\n\n```go\nfunc (m *MockoffsetStore) UpdateAckedOffset(ctx context.Context, topic, partitionKey string, offset int64, consumerGroup string) error\n```\nUpdateAckedOffset mocks base method.\n\n```go\ntype MockoffsetStoreMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockoffsetStoreMockRecorder is the mock recorder for MockoffsetStore.\n\n```go\nfunc (mr *MockoffsetStoreMockRecorder) GetAckedOffset(ctx, topic, partitionKey, consumerGroup any) *gomock.Call\n```\nGetAckedOffset indicates an expected call of GetAckedOffset.\n\n```go\nfunc (mr *MockoffsetStoreMockRecorder) GetMinAckedOffset(ctx, topic, partitionKey any) *gomock.Call\n```\nGetMinAckedOffset indicates an expected call of GetMinAckedOffset.\n\n```go\nfunc (mr *MockoffsetStoreMockRecorder) Initialize(ctx, topic, partitionKey, consumerGroup any) *gomock.Call\n```\nInitialize indicates an expected call of Initialize.\n\n```go\nfunc (mr *MockoffsetStoreMockRecorder) UpdateAckedOffset(ctx, topic, partitionKey, offset, consumerGroup any) *gomock.Call\n```\nUpdateAckedOffset indicates an expected call of UpdateAckedOffset.\n\n```go\ntype MockpartitionLeaseStore struct {\n\t// contains filtered or unexported fields\n}\n```\nMockpartitionLeaseStore is a mock of partitionLeaseStore interface.\n\n```go\nfunc NewMockpartitionLeaseStore(ctrl *gomock.Controller) *MockpartitionLeaseStore\n```\nNewMockpartitionLeaseStore creates a new mock instance.\n\n```go\nfunc (m *MockpartitionLeaseStore) DiscoverAndAcquirePartitions(ctx context.Context, topic, subscriberName, consumerGroup string, leaseDurationMs int64, maxPartitions int) (int, []string, error)\n```\nDiscoverAndAcquirePartitions mocks base method.\n\n```go\nfunc (m *MockpartitionLeaseStore) EXPECT() *MockpartitionLeaseStoreMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MockpartitionLeaseStore) GetLeasedPartitions(ctx context.Context, topic, subscriberName, consumerGroup string) ([]string, error)\n```\nGetLeasedPartitions mocks base method.\n\n```go\nfunc (m *MockpartitionLeaseStore) ReleaseLease(ctx context.Context, topic, partitionKey, subscriberName, consumerGroup string) error\n```\nReleaseLease mocks base method.\n\n```go\nfunc (m *MockpartitionLeaseStore) RenewLease(ctx context.Context, topic, partitionKey, subscriberName, consumerGroup string, leaseDurationMs int64) error\n```\nRenewLease mocks base method.\n\n```go\nfunc (m *MockpartitionLeaseStore) TryAcquireLease(ctx context.Context, topic, partitionKey, subscriberName, consumerGroup string, leaseDurationMs int64) (bool, error)\n```\nTryAcquireLease mocks base method.\n\n```go\ntype MockpartitionLeaseStoreMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMockpartitionLeaseStoreMockRecorder is the mock recorder for MockpartitionLeaseStore.\n\n```go\nfunc (mr *MockpartitionLeaseStoreMockRecorder) DiscoverAndAcquirePartitions(ctx, topic, subscriberName, consumerGroup, leaseDurationMs, maxPartitions any) *gomock.Call\n```\nDiscoverAndAcquirePartitions indicates an expected call of DiscoverAndAcquirePartitions.\n\n```go\nfunc (mr *MockpartitionLeaseStoreMockRecorder) GetLeasedPartitions(ctx, topic, subscriberName, consumerGroup any) *gomock.Call\n```\nGetLeasedPartitions indicates an expected call of GetLeasedPartitions.\n\n```go\nfunc (mr *MockpartitionLeaseStoreMockRecorder) ReleaseLease(ctx, topic, partitionKey, subscriberName, consumerGroup any) *gomock.Call\n```\nReleaseLease indicates an expected call of ReleaseLease.\n\n```go\nfunc (mr *MockpartitionLeaseStoreMockRecorder) RenewLease(ctx, topic, partitionKey, subscriberName, consumerGroup, leaseDurationMs any) *gomock.Call\n```\nRenewLease indicates an expected call of RenewLease.\n\n```go\nfunc (mr *MockpartitionLeaseStoreMockRecorder) TryAcquireLease(ctx, topic, partitionKey, subscriberName, consumerGroup, leaseDurationMs any) *gomock.Call\n```\nTryAcquireLease indicates an expected call of TryAcquireLease.\n\n```go\ntype MocksubscriberHeartbeatStore struct {\n\t// contains filtered or unexported fields\n}\n```\nMocksubscriberHeartbeatStore is a mock of subscriberHeartbeatStore interface.\n\n```go\nfunc NewMocksubscriberHeartbeatStore(ctrl *gomock.Controller) *MocksubscriberHeartbeatStore\n```\nNewMocksubscriberHeartbeatStore creates a new mock instance.\n\n```go\nfunc (m *MocksubscriberHeartbeatStore) ActiveSubscribers(ctx context.Context, topic, consumerGroup string, staleDurationMs int64) ([]string, error)\n```\nActiveSubscribers mocks base method.\n\n```go\nfunc (m *MocksubscriberHeartbeatStore) Deregister(ctx context.Context, topic, subscriberName, consumerGroup string) error\n```\nDeregister mocks base method.\n\n```go\nfunc (m *MocksubscriberHeartbeatStore) EXPECT() *MocksubscriberHeartbeatStoreMockRecorder\n```\nEXPECT returns an object that allows the caller to indicate expected use.\n\n```go\nfunc (m *MocksubscriberHeartbeatStore) Heartbeat(ctx context.Context, topic, subscriberName, consumerGroup string) error\n```\nHeartbeat mocks base method.\n\n```go\ntype MocksubscriberHeartbeatStoreMockRecorder struct {\n\t// contains filtered or unexported fields\n}\n```\nMocksubscriberHeartbeatStoreMockRecorder is the mock recorder for MocksubscriberHeartbeatStore.\n\n```go\nfunc (mr *MocksubscriberHeartbeatStoreMockRecorder) ActiveSubscribers(ctx, topic, consumerGroup, staleDurationMs any) *gomock.Call\n```\nActiveSubscribers indicates an expected call of ActiveSubscribers.\n\n```go\nfunc (mr *MocksubscriberHeartbeatStoreMockRecorder) Deregister(ctx, topic, subscriberName, consumerGroup any) *gomock.Call\n```\nDeregister indicates an expected call of Deregister.\n\n```go\nfunc (mr *MocksubscriberHeartbeatStoreMockRecorder) Heartbeat(ctx, topic, subscriberName, consumerGroup any) *gomock.Call\n```\nHeartbeat indicates an expected call of Heartbeat.\n\n```go\ntype Params struct {\n\t// DB is the database connection (required)\n\tDB *sql.DB\n\n\t// Logger for debugging and observability (required)\n\tLogger *zap.Logger\n\n\t// MetricsScope for metrics collection (required)\n\tMetricsScope tally.Scope\n\n\t// OnSignal receives typed subscriber lifecycle signals (HookSignal).\n\t// Nil in production; used by integration tests for event-driven waits.\n\tOnSignal chan HookSignal\n}\n```\nParams holds dependencies for creating a SQL queue\n\n","path":"github.com/uber/submitqueue/platform/extension/messagequeue/mysql","name":"mysql","synopsis":"Package mysql is a generated GoMock package.","isRedistributable":true}
