Skip to content
This repository was archived by the owner on Feb 8, 2018. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

13 Commits

Repository files navigation


⚠️⚠️⚠️⚠️⚠️


This project is not maintained anymore! Please check here for alternatives. This repository is kept online for reference purposes only and can be taken offline/deleted any time.


⚠️⚠️⚠️⚠️⚠️


Order Server

Go Report Card

This service for Element43 takes market data off the orders queue from NSQ (generated by emdr-to-nsq) and stores it for later retrieval via the API. The orders are stored as Snappy compressed JSON strings bundled by market (regionID+typeID) in a PostgreSQL instance.

Installation

Either use the prebuilt Docker images and pass the appropriate env vars (see below), or:

  • Clone this repo into your gopath
  • Run go get
  • Run go build

Deployment Info

Builds and releases are handled by Drone.

Environment VariableDefaultDescription
LOG_LEVELinfoThreshold for logging messages to be printed
PORT8000Port for the API to listen on
NSQ_URLnsqd:4150Hostname/IP of the NSQD instance to connect to
POSTGRES_URLpostgres://order-server@localhost:5432/order-server?sslmode=disableURL to this service's Postgres database

Todo

  • Improve compression story, no gzip support so far (saves CPU time)
  • Add proper caching backend (dynamic invalidation as new market data comes in)
  • General code cleanup (this is my second Go project), add performance metrics collection

Endpoints

Prefix: /api/orders/v1

URL PatternDescription
/region/:regionID/Get all orders in a region - this can be a lot of data, think around 60MB of JSON for The Forge!
/type/:typeID/Get all orders of a type
/region/:regionID/type/:typeID/Get all orders of a type in a region. Similar to the market view in game

The return values share a similar schema. Truncated example output for api/orders/v1/region/10000002/type/34/:

[
{
"orderID": 3664144403,
"regionID": 10000002,
"typeID": 34,
"generatedAt": "2017-03-18T12:28:24+00:00",
"price": 3.35,
"volRemaining": 102824006,
"range": 0,
"volEntered": 120000000,
"minVolume": 1,
"bid": true,
"issueDate": "2017-03-16T09:26:33+00:00",
"duration": 90,
"stationID": 60001873,
"solarSystemID": 30000165
},
{
"orderID": 4647080938,
"regionID": 10000002,
"typeID": 34,
"generatedAt": "2017-03-18T12:28:24+00:00",
"price": 0.07,
"volRemaining": 99582322,
"range": 0,
"volEntered": 100000000,
"minVolume": 1,
"bid": true,
"issueDate": "2017-02-13T14:38:29+00:00",
"duration": 90,
"stationID": 60003760,
"solarSystemID": 30000142
}
]

About

DEPRECATED - Market data API for Element43

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages