Giter Site home page Giter Site logo

fetcher's Introduction

Fetcher

This service allows to execute HTTP requests to other resources in the worker pool and store results.

API Endpoints:

POST /task/fetch allow the service to perform an HTTP request to a specific resource.

For example:

curl -X POST \
  http://localhost:8080/task/fetch \
  -H 'Content-Type: application/json' \
  -d '{
	"method": "GET",
	"address": "http://ozon.ru/context/detail/id/200",
	"headers": {
		"Content-Type": "text/html;charset=windows-1251",
		"Allow": "GET",
		"Content-Length": "1984"
	},
	"body": "some text"
}'

All requests are performed by a special pool worker in the goroutines. Pool worker settings (number of workers, buffer size) located in pkg/services/pool/fetch_pool.go.

GET /task/{id} returns task by id.

DELETE /task/{id} removes task by id.

GET /tasks returns all tasks from storage.

GET /tasks/page/{id} returns tasks by pages

The value of the count of tasks per one page is stored in the TasksPerPageCount in pkg/settings/task.go.

fetcher's People

Contributors

djagger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.