gateway

command module
v0.0.0-...-f0e5f80 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

CircleCI Go Report Card Docker Cloud Build Status MicroBadger Size (tag) Docker Cloud Automated build license

gateway

State

Paused. Primary use case (handling 'maintenance' case in Kubernetes cluster when admins have access to all regular ingress routes while other users receive 'maintenance in progress' page) can be solved via built-in functionality in SSO tool, e.g. Keycloak.

Usage

Create config with proxy rules:

rules:
  - from: "/task/"
    to: "https://jsonplaceholder.typicode.com/todos/"

Starts gateway with this config on your local machine on port 3000:

docker run -it -p 3000:3000 \
  -v /path/to/config.yaml:/config.yaml \
  estambakio/gateway:master \
    --config /config.yaml

Open terminal and make a request:

curl -v http://localhost:3000/task/1

This will respond with content from https://jsonplaceholder.typicode.com/todos/1

Args
  • -c or --config - path to config file, required
Environment variables
  • PORT - port to start server on, 3000 by default

Development

go test -v -cover ./...

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
gateway
Package gateway holds decision-making logic for determining target URL
Package gateway holds decision-making logic for determining target URL

Jump to

Keyboard shortcuts

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