Sign inSign up

delfer/go-static-responser

By delfer

•Updated over 7 years ago

Send static HTTP response fast and log (optional) visits to ClickHouse

Image
1

421

delfer/go-static-responser repository overview

⁠Go Static Responser

Docker Stars Docker Pulls Docker Automated build Docker Build Status MicroBadger Layers MicroBadger Size

Send static HTTP response fast and log visits to ClickHouse

⁠Features

  • Response very fast to / URI with static string
  • Log every visit to Yandex ClickHouse
  • Configurable by environment variables
  • Shows buffer size on /load

⁠Configuration

Environment variables:

  • PORT - HTTP listen port (8080 by default)
  • RESPONSE - string which response to GET /
  • BUFFER - buffer size (in requests) between HTTP server and DB writer (100,000 bн default)
  • DISABLE_CH - set true to disable writing to ClickHouse
  • ClickHouse connection
    • CH_HOST - host (127.0.0.1 by default)
    • CH_PORT - port (9000 by default)
    • CH_DEBUG - debug enabled true/false (false by default)
    • CH_USER - user (empty=default by default)
    • CH_PASSWORD - password (nothing by default)
    • CH_DB - database (empty=default by default)

⁠Usage

docker run -d --restart always \
    -e RESPONSE="Hello!" \
    -e CH_HOST=10.0.0.1 \
    -e CH_PASSWORD="password" \
    -p 8080:8080 delfer/go-static-responser

Open http://10.0.0.1/⁠ in you browser or by curl to make new visit, open http://10.0.0.1/load⁠ to get current buffer usage

⁠License

MIT

Tag summary

Content type

Image

Digest

Size

4.2 MB

Last updated

over 7 years ago

docker pull delfer/go-static-responser