schooner

command module
v0.0.0-...-2da2eef Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: GPL-3.0 Imports: 7 Imported by: 0

README

schooner

Build Status Go Report Card

Simple proxy server.

Features

  • Proxy requests to targets
  • Round-robin load balancing
  • Cache requests
  • Generates unique time-based correlation id for each request (set Correlation-Id header)

Configuration

Application supports configuration via environment variables:

PORT=8000 (default 8000)
STALE_TIMEOUT=60 (default 60 - minutes) - used for deleting unavailable targets
MACHINE_ID=0 - used for correlation id generator
USE_CACHE=1  (1 - use / 0 - don't use)
CACHE_EXPIRE=60  # seconds - ttl
MAX_CACHE_SIZE=1000000  # kb
MAX_CACHE_ITEM_SIZE=10000  #kb
TARGETS=http://example:8001;http://example2:8001

Installation

With docker
$> docker pull freundallein/schooner
With source
$> git clone git@github.com:freundallein/schooner.git
$> cd schooner
$> make build

Usage

Docker-compose

version: "3.5"

networks:
  network:
    name: example-network
    driver: bridge

services:
  schooner:
    image: freundallein/schooner:latest
    container_name: schooner
    restart: always
    environment: 
      - PORT=8000
      - MACHINE_ID=0
      - USE_CACHE=1
      - CACHE_EXPIRE=60  # seconds
      - MAX_CACHE_SIZE=1000000  # kb
      - MAX_CACHE_ITEM_SIZE=10000  #kb
      - TARGETS=http://example:8001;http://example2:8001
      - STALE_TIMEOUT=1 # min
    networks: 
      - network
    ports:
      - 8000:8000
    depends_on: 
      - example
      - example2

  example:
    image: freundallein/schooner-example:latest
    container_name: example
    networks: 
      - network
  example2:
    image: freundallein/schooner-example:latest
    container_name: example2
    networks: 
      - network

Metrics

Default prometheus metrics are available on /schooner/metrics

Healthcheck

Service healthcheck is avaliable on /schooner/healthz.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
infrastructure

Jump to

Keyboard shortcuts

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