Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsUnlockedCondition ¶
func IsUnlockedCondition() expression.ConditionBuilder
IsUnlockedCondition is a global property that represents the condition for getting the next unlocked queue item.
Types ¶
type DDBQueueItem ¶
type DDBQueueItem struct { ID string Data QueueItem Locked bool LockTime int64 // contains filtered or unexported fields }
DDBQueueItem represents an item in a DynamoDB queue.
func NewDDBQueueItem ¶
func NewDDBQueueItem(data QueueItem, q *DynamoDBQueue) *DDBQueueItem
NewDDBQueueItem creates a new DDBQueueItem instance with the specified ID and data.
func NewDDBQueueItemWithOptions ¶
func NewDDBQueueItemWithOptions(item map[string]*dynamodb.AttributeValue, q *DynamoDBQueue) *DDBQueueItem
NewDDBQueueItem creates a new DDBQueueItem instance with the specified ID, data, locked status, lock time, DynamoDB service, and logger.
func (*DDBQueueItem) AV ¶
func (item *DDBQueueItem) AV() map[string]*dynamodb.AttributeValue
AV returns the item as a map of DynamoDB attribute values.
func (*DDBQueueItem) Lock ¶
func (item *DDBQueueItem) Lock() error
Lock locks the item in the queue.
func (*DDBQueueItem) Unlock ¶
func (item *DDBQueueItem) Unlock() error
Unlock unlocks the item in the queue.
type DynamoDBQueue ¶
type DynamoDBQueue struct { TableName string QueueName string // contains filtered or unexported fields }
DynamoDBQueue represents a queue backed by a DynamoDB table.
func (*DynamoDBQueue) AddItem ¶
func (q *DynamoDBQueue) AddItem(queueItem QueueItem) error
Push adds an item to the queue.
func (*DynamoDBQueue) Done ¶
func (q *DynamoDBQueue) Done(item QueueItem) error
Done removes the specified item from DynamoDB.
func (*DynamoDBQueue) GenerateQueueItemID ¶
func (q *DynamoDBQueue) GenerateQueueItemID() string
GenerateQueueItemID generates a new ID for a QueueItem.
func (*DynamoDBQueue) GetNextItem ¶
func (q *DynamoDBQueue) GetNextItem() (QueueItem, error)
Pop locks and returns the next item from the queue.