worker

command module
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

README

Worker

Go Report Status Discord Chat Lab release Dockerimages MIT License

Worker is a simple HTTP server that accepts FQL queries, executes them and returns their results.

Quick start

The Worker is shipped with dedicated Docker image that contains headless Google Chrome, so feel free to run queries using cdp driver:

docker run -d -p 8080:8080 montferret/worker:latest

Alternatively, if you want to use your own version of Chrome, you can run the Worker locally:

make

And then just make a POST request:

worker

System Resource Requirements

  • 2 CPU
  • 2 Gb of RAM

Usage

Endpoints
POST /

Executes a given query. The payload must have the following shape:

Query {
    text: String!
    params: Map<string, any>
}
GET /version

Returns a version information about Chrome, Ferret and itself. Has the following shape:

Version {
    worker: String!
    chrome: {
        browser: String!
        protocol: String!
        v8: String!
        webkit: String!
    }
    ferret: String!
}
GET /health

Health check endpoint (for Kubernetes, e.g.). Returns empty 200.

Run commands
  -chrome-ip string
        Google Chrome remote IP address (default "127.0.0.1")
  -chrome-port uint
        Google Chrome remote debugging port (default 9222)
  -help
        show this list
  -port uint
        port to listen (default 8080)
  -version
        show version

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

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