task

module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2023 License: Apache-2.0, BSD-3-Clause, MIT

README

pipeline status coverage report

Task Service

The task service provides an HTTP interface for executing asynchronous (HTTP) tasks and task lists.

It is developed using the Goa v3 framework.

While the service is up and running, you can see a live Swagger API description at servicehost:serviceport/swagger-ui. In the local docker-compose environment, the Swagger URL is available at http://localhost:8082/swagger-ui/

High-level Overview
flowchart LR  
	A([client]) -- HTTP --> B[Task API] 
	subgraph task
        B --- C[(Storage)]
        C --- E[Executor]
        B --> D[(Queue)]
        D --> E[Executor]
	end 
	E --> F[Policy]
	E --> G[Cache]

Tasks are created by clients making HTTP requests. In order to create a Task, a TaskTemplate must be present in the Storage. The newly created tasks are added to a Queue. Current implementation of the Queue interface is a persistent database. An executor component is retrieving tasks from the Queue for execution. Clients receive an immediate response with the taskID for the created task and can later query the state of task and retrieve its result either by directly querying the Cache service, or by querying the task HTTP interface for task results.

More information
Cache events

Task service is able to subscribe for events produced by the Cache service and create a Task for every received event. Current implementation uses NATS for messaging system.

More information
Tests and Linters

To execute the units tests for the service go to the root project directory and run:

go test -race ./...

To run the linters go to the root project directory and run:

golangci-lint run

Dependencies

The project uses Go modules for managing dependencies, and we commit the vendor directory. When you add/change dependencies, be sure to clean and update the vendor directory before submitting your Merge Request for review.

go mod tidy
go mod vendor

Dependencies

License


Apache 2.0 license

Directories

Path Synopsis
cmd
nolint:revive
nolint:revive
gen
internal
service/servicefakes
Code generated by counterfeiter.
Code generated by counterfeiter.
service/task/taskfakes
Code generated by counterfeiter.
Code generated by counterfeiter.
service/tasklist/tasklistfakes
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL