You need to have go
installed and GOPATH
set correctly.
go get -u github.com/sandyleo26/sydney_weather
cd $GOPATH/src/github.com/sandyleo26/sydney_weather
make setup
make
I use curl
for testing. But tools like postman also works.
curl http://localhost:8080/v1/weather?city=sydney
Trade-offs:
- only Sydney is supported and only wind and temperature are returned
- it's still possible to burden service providers once cache expired
- no authorization is performed
- it uses in memory cache which is not scalable
Things could be improved: All the points above could be considered if time permitted. For example, I'm interested to use memcached to serve as cache so it's more scalable. Also, I want to build a simple front end for the service using React.