-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
259 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
FROM golang:1.6-alpine | ||
RUN apk update && apk add git | ||
RUN go get github.com/Masterminds/glide | ||
COPY . /go/src/open-algot.servebeer.com/open-algot/open-algot-platform/ | ||
WORKDIR /go/src/open-algot.servebeer.com/open-algot/open-algot-platform | ||
COPY . /go/src/github.com/nii236/nii-finance | ||
WORKDIR /go/src/github.com/nii236/nii-finance | ||
RUN glide up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM openalgotplatform_go:0.1 | ||
WORKDIR /go/src/open-algot.servebeer.com/open-algot/open-algot-platform/services/BitstampTickSubscriber | ||
COPY . /go/src/open-algot.servebeer.com/open-algot/open-algot-platform/ | ||
WORKDIR /go/src/github.com/nii236/nii-finance/services/BitstampTickSubscriber | ||
COPY . /go/src/github.com/nii236/nii-finance/ | ||
RUN go install | ||
ENTRYPOINT ["BitstampTickSubscriber"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
FROM openalgotplatform_go:0.1 | ||
WORKDIR /go/src/open-algot.servebeer.com/open-algot/open-algot-platform/services/OandaTickSubscriber | ||
COPY . /go/src/open-algot.servebeer.com/open-algot/open-algot-platform/ | ||
WORKDIR /go/src/github.com/nii236/nii-finance/services/OandaTickSubscriber | ||
COPY . /go/src/github.com/nii236/nii-finance/ | ||
RUN go install | ||
ENTRYPOINT ["OandaTickSubscriber"] |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM python:2.7-alpine | ||
|
||
MAINTAINER [email protected] | ||
|
||
RUN pip install werkzeug | ||
RUN pip install requests | ||
RUN pip install protobuf | ||
|
||
|
||
EXPOSE 4000 | ||
|
||
ADD . /python_app | ||
|
||
WORKDIR /python_app | ||
|
||
CMD [ "python", "yahoo_ticker.py" ] | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Created on Thu Jun 02 22:36:21 2016 | ||
@author: Jacob | ||
""" | ||
|
||
import test_pb2 | ||
import requests | ||
|
||
payload = {"jsonrpc": "2.0", | ||
"method": "postMessage", | ||
"params": [{"name": "Jacob"}], | ||
"id": 99} | ||
|
||
msg = test_pb2.MessageData() | ||
msg.id = 1234 | ||
msg.name = "John Doe" | ||
|
||
url = "http://127.0.0.1:4000" | ||
|
||
# POST with protobuf | ||
r = requests.post(url, data=msg.SerializeToString()) | ||
|
||
print r.text | ||
print r.headers['content-type'] | ||
print r.status_code | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package openalgot; | ||
|
||
message MessageData { | ||
required string name = 1; | ||
required int32 id = 2; | ||
} | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
# -*- coding: utf-8 -*- | ||
""" | ||
Spyder Editor | ||
This is a temporary script file. | ||
""" | ||
|
||
# pip install websocket-client | ||
# pip install protobuf | ||
# pandas | ||
# numpy | ||
|
||
|
||
|
||
#import pandas.io.data as web | ||
#import websocket | ||
#import numpy as np | ||
#import requests | ||
|
||
|
||
import test_pb2 | ||
|
||
|
||
|
||
from werkzeug.wrappers import Request, Response | ||
from werkzeug.serving import run_simple | ||
#from jsonrpc import JSONRPCResponseManager, dispatcher | ||
|
||
import uuid | ||
import requests | ||
import json | ||
|
||
#// units ns|us|ms|s|m|h | ||
#// http://127.0.0.1:8081/registry?ttl=10s | ||
|
||
payload={"Name": "foo.bar", | ||
"Nodes": [{ | ||
"Port": 9091, | ||
"Address": "127.0.0.1", | ||
"Id": "foo.bar-017da09a-734f-11e5-8136-68a86d0d36b6" | ||
}]} | ||
|
||
def register(): | ||
register_uri = "http://192.168.99.100:8081/registry" | ||
service = "go.micro.srv.yahoo" | ||
headers = {'content-type': 'application/json'} | ||
payload = { | ||
"name": service, | ||
"nodes": [{ | ||
"id": service + "-" + str(uuid.uuid4()), | ||
"address": "192.168.0.7", | ||
"port": 4000, | ||
}], | ||
} | ||
requests.post(register_uri, data=json.dumps(payload), headers=headers) | ||
|
||
@Request.application | ||
def application(request): | ||
# Dispatcher is dictionary {<method_name>: callable} | ||
|
||
#dispatcher["postMessage"] = lambda s: "hello " + s["name"] | ||
|
||
msg = test_pb2.MessageData() | ||
msg.ParseFromString(request.data) | ||
|
||
#response = JSONRPCResponseManager.handle( | ||
# request.data, dispatcher) | ||
#return Response(response.json, mimetype='application/json') | ||
|
||
return Response(msg.SerializeToString(), mimetype='application/octet-stream') | ||
|
||
|
||
if __name__ == '__main__': | ||
print "registering service" | ||
#register() | ||
print "running service" | ||
run_simple('localhost', 4000, application) | ||
|
||
|
||
|
||
|
||
#r = requests.post('http://192.168.99.100:8081', json=payload) | ||
|
||
|
||
#r = requests.get('http://192.168.99.100:8081/registry') | ||
#print r.status_code | ||
#print r.headers['content-type'] | ||
|
||
#r = requests.get('http://192.168.99.100:8081/registry') | ||
#print r.text | ||
|
||
|
||
#ws = websocket.WebSocket() | ||
#ws.connect("ws://192.168.99.100:8081/broker?topic=go.micro.srv.BitstampRecorder") | ||
#ws.connect("ws://192.168.99.100:8081/broker?topic=go.micro.srv.TickRecorder") | ||
#print ws.recv() | ||
|
||
#ws://192.168.0.12:8081/broker?topic=go.micro.srv.TickRecorder | ||
|
||
|
||
#foo = np.random.randint(0, 10, (4,5,6)) | ||
|
||
#print foo | ||
|
||
#print foo.mean(axis=0) | ||
|
||
|
||
#DAX = web.DataReader(name='GOOG', data_source='yahoo', start='2000-1-1') | ||
#DAX.info() | ||
#DAX['Close'].plot() | ||
|
||
#print DAX.tail() | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM openalgotplatform_go:0.1 | ||
WORKDIR /go/src/open-algot.servebeer.com/open-algot/open-algot-platform/services/Sidecar | ||
FROM openalgotplatform_go:0.1 | ||
WORKDIR /go/src/github.com/nii236/nii-finance/services/Sidecar | ||
RUN go install | ||
ENTRYPOINT ["Sidecar"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM openalgotplatform_go:0.1 | ||
WORKDIR /go/src/open-algot.servebeer.com/open-algot/open-algot-platform/services/TickRecorder | ||
FROM openalgotplatform_go:0.1 | ||
WORKDIR /go/src/github.com/nii236/nii-finance/services/TickRecorder | ||
RUN go install | ||
ENTRYPOINT ["TickRecorder"] |