24 lines
1.1 KiB
Go
24 lines
1.1 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
)
|
|
|
|
type Task struct {
|
|
ID primitive.ObjectID `bson:"_id,omitempty" json:"id"`
|
|
ApplicationId string `bson:"applicationId,omitempty" json:"applicationId"`
|
|
Payload interface{} `bson:"payload,omitempty" json:"payload"`
|
|
Priority int `bson:"priority,omitempty" json:"priority"` // higher first
|
|
AvailableAt time.Time `bson:"availableAt,omitempty" json:"availableAt"`
|
|
Status string `bson:"status,omitempty" json:"status"`
|
|
LeaseOwner string `bson:"leaseOwner,omitempty" json:"leaseOwner"`
|
|
LeasedUntil time.Time `bson:"leasedUntil,omitempty" json:"leasedUntil"`
|
|
Attempts int `bson:"attempts,omitempty" json:"attempts"`
|
|
MaxAttempts int `bson:"maxAttempts,omitempty" json:"maxAttempts"`
|
|
CreatedAt time.Time `bson:"createdAt,omitempty" json:"createdAt"`
|
|
UpdatedAt time.Time `bson:"updatedAt,omitempty" json:"updatedAt"`
|
|
Error string `bson:"error,omitempty" json:"error,omitempty"`
|
|
}
|