Documentation
¶
Index ¶
- func NewPostgresTaskRepository(pool *pgxpool.Pool) port.TaskRepository
- type CreateTaskParams
- type DBTX
- type ListEligibleTasksParams
- type PostgresTaskRepository
- func (r *PostgresTaskRepository) Create(ctx context.Context, task *domain.Task) error
- func (r *PostgresTaskRepository) Get(ctx context.Context, id string) (*domain.Task, error)
- func (r *PostgresTaskRepository) ListEligible(ctx context.Context, now time.Time, limit int) ([]*domain.Task, error)
- func (r *PostgresTaskRepository) ListTasks(ctx context.Context, filter *domain.TaskFilter) ([]*domain.Task, error)
- func (r *PostgresTaskRepository) ReleaseTasks(ctx context.Context, workerID string) error
- func (r *PostgresTaskRepository) Update(ctx context.Context, task *domain.Task) error
- type Queries
- func (q *Queries) CreateTask(ctx context.Context, arg CreateTaskParams) error
- func (q *Queries) GetTask(ctx context.Context, id pgtype.UUID) (Task, error)
- func (q *Queries) ListEligibleTasks(ctx context.Context, arg ListEligibleTasksParams) ([]Task, error)
- func (q *Queries) ReleaseTasks(ctx context.Context, workerID pgtype.Text) error
- func (q *Queries) UpdateTask(ctx context.Context, arg UpdateTaskParams) error
- func (q *Queries) WithTx(tx pgx.Tx) *Queries
- type Task
- type UpdateTaskParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPostgresTaskRepository ¶
func NewPostgresTaskRepository(pool *pgxpool.Pool) port.TaskRepository
Types ¶
type CreateTaskParams ¶
type CreateTaskParams struct {
ID pgtype.UUID
ClientID string
TaskType string
Payload []byte
State string
RunAt pgtype.Timestamptz
WorkerID pgtype.Text
Result []byte
RetryCount int32
MaxRetries int32
TimeoutSeconds int32
LastFailedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type ListEligibleTasksParams ¶
type ListEligibleTasksParams struct {
RunAt pgtype.Timestamptz
Limit int32
}
type PostgresTaskRepository ¶
type PostgresTaskRepository struct {
// contains filtered or unexported fields
}
func (*PostgresTaskRepository) ListEligible ¶
func (*PostgresTaskRepository) ListTasks ¶
func (r *PostgresTaskRepository) ListTasks(ctx context.Context, filter *domain.TaskFilter) ([]*domain.Task, error)
func (*PostgresTaskRepository) ReleaseTasks ¶
func (r *PostgresTaskRepository) ReleaseTasks(ctx context.Context, workerID string) error
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) CreateTask ¶
func (q *Queries) CreateTask(ctx context.Context, arg CreateTaskParams) error
func (*Queries) ListEligibleTasks ¶
func (*Queries) ReleaseTasks ¶
func (*Queries) UpdateTask ¶
func (q *Queries) UpdateTask(ctx context.Context, arg UpdateTaskParams) error
type Task ¶
type Task struct {
ID pgtype.UUID
ClientID string
TaskType string
Payload []byte
State string
RunAt pgtype.Timestamptz
WorkerID pgtype.Text
Result []byte
RetryCount int32
MaxRetries int32
TimeoutSeconds int32
LastFailedAt pgtype.Timestamptz
CreatedAt pgtype.Timestamptz
UpdatedAt pgtype.Timestamptz
}
type UpdateTaskParams ¶
Click to show internal directories.
Click to hide internal directories.