Files
eway/internal/entity/task.go
Aleksandr Trushkin b0a185561d queue api
2024-02-03 18:15:26 +03:00

24 lines
345 B
Go

package entity
import (
"context"
"time"
)
type PublishParams struct {
Body []byte
ExpiresAt time.Time
}
type MessageQueue interface {
Publish(context.Context, PublishParams) (Task, error)
Consume(context.Context) (Task, error)
}
type Task struct {
ID uint64
CreatedAt time.Time
ExpiresAt *time.Time
Body []byte
}