Code Monkey home page Code Monkey logo

router-go's Introduction

Router App

Running App

  • Start app:

    docker-compose up --build
  • If you need run local for debugging, comment app service into docker-compose.yaml and start using run command or using debugger (F5 main.go on VSCode).

  • Use postman collection (Router.postman_collection.json) to test apis.

Endpoints

Service Endpoint
Prometheus http://localhost:9000
Grafana http://localhost:3000
Jaeger http://localhost:16686
Swagger UI http://localhost:8080/index.html

How It Works

Request Flow

flowchart TD
    Req[Request] --> |1. Handle this|R
    R[Router] --> |2. Give me healthy Server based on <BR> this prefix URL and Zone AWS|SP[Server Pool]
    SP --> |3. Here is a <BR> Healthy Server|R
    R --> |4. Handle Request| HS[Healthy Server]
    HS --> |5. Here is a response |R
    R ----> |6. OK/Error |Res[Response]
Loading

HealthCheck Flow

TODO

  • New app to control healthcheck (all instances of this app is updating cache - race conditions and multiple calls to backends healthcheck)
  • Run on Kubernetes
  • Performance tests

Helpful Commands

# Init go lang project
go mod init github.com/ortisan/<project_name>
# Import module
go get -u <module>
# Run main
go run main.go
# Build project
go build -o <sh/exe name>
# Generate swagger
swag init -g main.go --output docs
# Send notification
awslocal sns publish --topic-arn arn:aws:sns:sa-east-1:000000000000:health-cells-topic --message 'testing' --endpoint-url=http://localhost:4566
# Read SQS Message
awslocal sqs receive-message --queue-url http://localhost:4566/000000000000/health-cells-queue --endpoint-url=http://localhost:4566

# Build and start docker-compose
sh build.sh

router-go's People

Contributors

ortisan avatar

Watchers

 avatar  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.