Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM golang:1.7.4-alpine

ADD server.go $GOPATH/src/fake-quoteserv/server.go

RUN go build \
-o $GOPATH/bin/fake-quoteserv \
$GOPATH/src/fake-quoteserv/server.go

EXPOSE 4443

CMD $GOPATH/bin/fake-quoteserv
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AFAIK the quote server has no published API or other docs ([this][quote-server-c
_TBD_

#### Local Usage
Start the server and stablish a socket connection and send a formatted req `stock_symbol,user_id`:
Start the server, establish a socket connection and send a formatted request: `stock_symbol,user_id`.
```bash
go run server.go

Expand All @@ -19,7 +19,7 @@ echo "XYZ,cool_user" | nc localhost 4443
# server sends
729.99,XYZ,cool_user,1484459366,WFlaY29vbF91c2Vy77+9
```
Return format is `quote,stock_symbol,user_id,timestamp,cryptokey`.
Return format is: `quote,stock_symbol,user_id,timestamp,cryptokey`.

[go-tcp-server-blog]: https://coderwall.com/p/wohavg/creating-a-simple-tcp-server-in-go
[quote-server-client]: http://www.ece.uvic.ca/~seng462/ProjectWebSite/ClientThread.py
25 changes: 25 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
IMG_NAME = quoteserv
PORT = 4443

.PHONY: run start stop clean tail

run:
docker run \
--publish $(PORT):$(PORT) \
--name $(IMG_NAME) \
--detach \
fake-quoteserv

docker ps

start:
docker start $(IMG_NAME)

stop:
docker stop $(IMG_NAME)

clean: stop
docker rm $(IMG_NAME)

tail:
docker logs -f $(IMG_NAME)