feat: Initial commit
This commit is contained in:
23
models/task.go
Normal file
23
models/task.go
Normal file
@@ -0,0 +1,23 @@
|
||||
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"`
|
||||
}
|
||||
Reference in New Issue
Block a user