Giter Club home page Giter Club logo

proxy-sink's Introduction

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

proxy-sink's People

Contributors

pentateu avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.