echo-service

command module
v0.0.0-...-21494fa Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 7 Imported by: 0

README

Golang high performance echo service

To install, use the docker image davidebianchi/echo-service

Usage

The service is very easy to set up.

It has only 3 optional env vars:

  • HTTP_PORT (default set to 8080): the port listening for http requests
  • LOG_LEVEL (default set to info): the log level of the service
  • RESPONSE_DELAY: the delay in time.Duration format between the request and the response. e.g. 1s, 10s

An example response of the service, running locally on :8080 and contacting it with GET method with query foo=bar on path /my-path:

{
  "request": {
    "headers": {
      "Accept": "text/html",
      "Host": "localhost:8080",
    },
    "query": {
      "foo": "bar"
    },
    "path": "/my-path",
    "method": "GET"
  }
}

With POST method and a request body, instead:

An example response of the service, running locally on :8080 and contacting it with query foo=bar on path /my-path:

{
  "request": {
    "headers": {
      "Accept": "text/html",
      "Host": "localhost:8080",
    },
    "query": {
      "foo": "bar"
    },
    "path": "/my-path",
    "method": "POST",
    "body": "my request body"
  }
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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