proxy-sink

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

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

Go to latest
Published: Oct 30, 2019 License: Apache-2.0 Imports: 20 Imported by: 0

README

proxy-sink

Reverse proxy with data sink on a SQLite database.

Useful to test http endpoints.

Configuration: config file (default is $HOME/.proxy-sink.yaml)

log: debug

services:
  proxy-sink:
    settings:
      port: 8387
      correlation-header: tp-api-correlation-id
      mode: sink
      mocks: ./mocks

  sink:
    settings:
      uri: file:memory:?mode=memory
  
  api:
    settings:
      port: "3120"

Mocks: The proxy sink will return a standard response with status 200 if you don't provide a mock file. If you provide a mock file, the status code and content from the mock file will be returned to the service calling the proxy sink.

# Example Mock File
{
    "statusCode": 200,
    "content": "mock content!"
}

Build:

docker build -t proxy-sink .

Linux build from windows (or any) machine:

docker run --rm -v "$PWD":/usr/src/proxy-sink -w /usr/src/proxy-sink golang:1.12 go build -v

Run :

docker run -it --rm proxy-sink proxy-sink start

Sequence Diagrams produced at https://www.websequencediagrams.com/ - code:

title Proxy-Sink

Source Application->Source Application: Start!

Proxy-Sink->+Proxy-Sink: proxy starts...
Proxy-Sink->Proxy-Sink: load config
Proxy-Sink->-Proxy-Sink: proxy started!

Source Application->+Proxy-Sink: Request
Proxy-Sink->Redis: Save request
Redis-->Proxy-Sink : ok
Proxy-Sink->+Proxy-Sink: if sink
Proxy-Sink-->-Source Application: test mock result
Proxy-Sink->+Proxy-Sink: if forward
Proxy-Sink->+Target Application: Request

Target Application-> Target Application: Proces
note right of Target Application
    Process request
end note

Target Application-->-Proxy-Sink: Result

Proxy-Sink-->-Source Application: Result


Quality Engineer->Redis: Query test results
Redis-->Quality Engineer:  results


 
Test Automation->Redis: Query test results
Redis-->Test Automation:  results

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳