feat: [wip] - implement storage

This commit is contained in:
sujit
2024-10-19 10:29:30 +05:45
parent 2fb9dfb803
commit 8fef4e69cc
8 changed files with 176 additions and 109 deletions

11
task.go
View File

@@ -5,6 +5,17 @@ import (
"time"
)
type Task struct {
CreatedAt time.Time `json:"created_at"`
ProcessedAt time.Time `json:"processed_at"`
Expiry time.Time `json:"expiry"`
Error error `json:"error"`
ID string `json:"id"`
Topic string `json:"topic"`
Status string `json:"status"`
Payload json.RawMessage `json:"payload"`
}
func NewTask(id string, payload json.RawMessage, nodeKey string) *Task {
if id == "" {
id = NewID()