Documentation
¶
Index ¶
- func CancelTaskEndpoint(svc services.TaskService) endpoint.Endpoint
- func CompleteTaskEndpoint(svc services.TaskService) endpoint.Endpoint
- func ConsumeQueueEndpoint(svc services.TaskService) endpoint.Endpoint
- func CreateTaskEndpoint(svc services.TaskService) endpoint.Endpoint
- func CreateTaskListEndpoint(svc services.TaskService) endpoint.Endpoint
- func DeleteTaskEndpoint(svc services.TaskService) endpoint.Endpoint
- func EnpointLoggingMiddleware(logger log.Logger) endpoint.Middleware
- func FailTaskEndpoint(svc services.TaskService) endpoint.Endpoint
- func HealthcheckEndpoint(client *redis.Client) endpoint.Endpoint
- func QueueNextEndpoint(svc services.TaskService, stateView view.TaskView, locker *redislock.Client) endpoint.Endpoint
- func QueueStatsEndpoint(view view.TaskView) endpoint.Endpoint
- func TaskStateEndpoint(svc view.TaskView) endpoint.Endpoint
- func TimeoutTaskEndpoint(svc services.TaskService) endpoint.Endpoint
- type CancelTaskRequest
- type CancelTaskResponse
- type CompleteTaskRequest
- type CompleteTaskResponse
- type ConsumeQueueRequest
- type CreateTaskListRequest
- type CreateTaskListResponse
- type CreateTaskRequest
- type CreateTaskResponse
- type DeleteTaskRequest
- type DeleteTaskResponse
- type FailTaskRequest
- type FailTaskResponse
- type HealthcheckResponse
- type QueueNextRequest
- type QueueStatsRequest
- type TaskDTO
- type TaskStateRequest
- type TaskStateResponse
- type TimeoutTaskRequest
- type TimeoutTaskResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CancelTaskEndpoint ¶
func CancelTaskEndpoint(svc services.TaskService) endpoint.Endpoint
CancelTaskEndpoint creates a endpoint for task complete
func CompleteTaskEndpoint ¶
func CompleteTaskEndpoint(svc services.TaskService) endpoint.Endpoint
CompleteTaskEndpoint creates a endpoint for task complete
func ConsumeQueueEndpoint ¶ added in v1.2.0
func ConsumeQueueEndpoint( svc services.TaskService, ) endpoint.Endpoint
ConsumeQueueEndpoint creates a endpoint for get next on queue
func CreateTaskEndpoint ¶
func CreateTaskEndpoint(svc services.TaskService) endpoint.Endpoint
CreateTaskEndpoint creates the endpoint that create a task
func CreateTaskListEndpoint ¶
func CreateTaskListEndpoint(svc services.TaskService) endpoint.Endpoint
CreateTaskEndpoint creates the endpoint that create a task
func DeleteTaskEndpoint ¶
func DeleteTaskEndpoint(svc services.TaskService) endpoint.Endpoint
CreateTaskEndpoint creates the endpoint that create a task
func EnpointLoggingMiddleware ¶
func EnpointLoggingMiddleware( logger log.Logger, ) endpoint.Middleware
func FailTaskEndpoint ¶
func FailTaskEndpoint(svc services.TaskService) endpoint.Endpoint
FailTaskEndpoint creates a endpoint for task complete
func HealthcheckEndpoint ¶
HealthcheckEndpoint creates a endpoint for healthcheck
func QueueNextEndpoint ¶
func QueueNextEndpoint( svc services.TaskService, stateView view.TaskView, locker *redislock.Client, ) endpoint.Endpoint
QueueNextEndpoint creates a endpoint for get next on queue
func QueueStatsEndpoint ¶ added in v1.2.0
QueueStatsEndpoint creates a endpoint for task complete
func TaskStateEndpoint ¶
TaskStateEndpoint creates a endpoint for task state
func TimeoutTaskEndpoint ¶
func TimeoutTaskEndpoint(svc services.TaskService) endpoint.Endpoint
TimeoutTaskEndpoint creates a endpoint for task complete
Types ¶
type CancelTaskRequest ¶
type CancelTaskRequest struct {
TaskID string `json:"task_id"`
}
CancelTaskRequest is the request to complete a task
type CancelTaskResponse ¶
type CancelTaskResponse struct {
Error string `json:"error,omitempty"`
}
CancelTaskResponse is the response of a task complete
type CompleteTaskRequest ¶
CompleteTaskRequest is the request to complete a task
type CompleteTaskResponse ¶
type CompleteTaskResponse struct {
Error string `json:"error,omitempty"`
}
CompleteTaskResponse is the response of a task complete
type ConsumeQueueRequest ¶ added in v1.2.0
type ConsumeQueueRequest struct {
Queue string `json:"queue"`
}
ConsumeQueueRequest is a request to get the next task in the queue
type CreateTaskListRequest ¶
type CreateTaskListRequest struct {
Tasks []CreateTaskRequest `json:"tasks"`
}
CreateTasListkRequest is a request to create a task
type CreateTaskListResponse ¶
type CreateTaskListResponse struct {
TaskIDs []string `json:"task_ids"`
Error string `json:"error,omitempty"`
}
CreateTaskResponse is the response of a task creation
type CreateTaskRequest ¶
type CreateTaskRequest struct {
Owner string `json:"owner"`
Queue string `json:"queue"`
Retries int32 `json:"retries"`
Timeout int32 `json:"timeout"`
Payload string `json:"payload"`
NotBefore int64 `json:"not_before"`
}
CreateTaskRequest is a request to create a task
type CreateTaskResponse ¶
type CreateTaskResponse struct {
TaskID string `json:"task_id"`
Error string `json:"error,omitempty"`
}
CreateTaskResponse is the response of a task creation
type DeleteTaskRequest ¶
type DeleteTaskRequest struct {
TaskID string `json:"task_id"`
}
CreateTaskRequest is a request to create a task
type DeleteTaskResponse ¶
CreateTaskResponse is the response of a task creation
type FailTaskRequest ¶
type FailTaskRequest struct {
TaskID string `json:"task_id"`
}
FailTaskRequest is the request to complete a task
type FailTaskResponse ¶
type FailTaskResponse struct {
Error string `json:"error,omitempty"`
}
FailTaskResponse is the response of a task complete
type HealthcheckResponse ¶
type HealthcheckResponse struct {
OK bool `json:"ok"`
}
type QueueNextRequest ¶
type QueueNextRequest struct {
Queue string `json:"queue"`
}
QueueNextRequest is a request to get the next task in the queue
type QueueStatsRequest ¶ added in v1.2.0
type QueueStatsRequest struct {
Queue string `json:"queue"`
}
QueueStatsRequest is the request to complete a task
type TaskDTO ¶
type TaskDTO struct {
TaskID string `json:"task_id"`
Owner string `json:"owner"`
TaskQueue string `json:"task_queue"`
Payload string `json:"payload"`
State string `json:"state"`
Timeout int32 `json:"timeout"`
Retries int32 `json:"retries"`
MaxRetries int32 `json:"max_retries"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
Result string `json:"result,omitempty"`
NotBefore int64 `json:"not_before"`
}
type TaskStateRequest ¶
type TaskStateRequest struct {
TaskID string `json:"task_id"`
}
TaskStateRequest is the request for the state of a task
type TaskStateResponse ¶
type TaskStateResponse struct {
Task *TaskDTO `json:"task,omitempty"`
Error string `json:"error,omitempty"`
}
TaskStateResponse is the response of a task state
type TimeoutTaskRequest ¶
type TimeoutTaskRequest struct {
TaskID string `json:"task_id"`
}
TimeoutTaskRequest is the request to complete a task
type TimeoutTaskResponse ¶
type TimeoutTaskResponse struct {
Error string `json:"error,omitempty"`
}
TimeoutTaskResponse is the response of a task complete