Skip to content

DistributedDesigns/quote_manager

Repository files navigation

Quote manager

Build Status

Service that handles interactions with the legacy quote server. Interaction takes place with RabbitMQ queues. Accepts incoming requests for quotes and broadcasts updates.

Installing

git clone https://github.com/DistributedDesigns/quote_manager.git
make install

# start Docker to host RMQ, Redis containers
make run

# You can call either of the next two lines
$GOPATH/bin/quote_manager
go run *.go # *.go since `package main` is spread over multiple files

Odds and ends

Specifying a config

Call the service with the --config=./path/to/config.yaml flag and point it at a .yaml file following the schema in ./config. The dev config is used by default.

Docker startup / teardown

  1. make run Creates new rabbit and redis containers
  2. make stop Pauses RMQ, redis containers and saves state
  3. make start Starts previously stopped RMQ, redis
  4. make clean Deletes RMQ, redis containers. make run to recreate them.

Redis namespace and key removal

All redis keys are prefixed with quotemgr: to separate them from other keys in the environment where one redis instance is shared between many services. You can call make redis-remove-keys to delete all keys quotemgr:* in the event you want the Quote Manager to start with a fresh cache without affecting other redis customers.

Installing the linter

metalinter will be run by CI. You can run the linter locally to check for problems early.

go get -u github.com/alecthomas/gometalinter

# Install all known linters
$GOPATH/bin/gometalinter --install

# Run the linter on all files the project
$GOPATH/bin/gometalinter --config=.gometalinterrc ./...

make install Will create a git hook that rejects pushes that fail the linter.

About

Service that provides stock quotes via RMQ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published