Skip to content

Commit

Permalink
* Moved structs into new file: models.go.
Browse files Browse the repository at this point in the history
* Moved constants into new file: constants.go.
* Changed name to GoLuas.
* Added DynamoDB client code.
* Refactored much of codebase into separate functions.
* Added error handling.
* Added fares API.
* Added v1 API support.
* Added Easter egg ;)
  • Loading branch information
thecosmicfrog committed Nov 12, 2018
1 parent 35e6eb4 commit a861a7d
Show file tree
Hide file tree
Showing 4 changed files with 301 additions and 100 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.idea
.vscode
GetLuas
GetLuas.zip
GoLuas
GoLuas.zip

13 changes: 13 additions & 0 deletions constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package main

const awsRegion string = "eu-west-1"
const dynamoDBTable string = "GoLuasStops"
const logPrefixError string = "ERROR"
const logPrefixInfo string = "INFO"
const responseMessageInvalidRequest string = `{"message": "Invalid request"}`
const responseMessageGeneralFaresError string = `{"message": "General error getting fares"}`
const responseMessageGeneralTimesError string = `{"message": "General error getting times"}`
const responseMessageImATeapot string = `{"message": "Your request to brew coffee with this server has failed. This HTCPCP server is a teapot. The requested entity body is short and stout. Tip me over and pour me out."}`
const responseMessageUnknownStop string = `{"message": "Unknown stop"}`
const rpaForecastURLV1 string = "http://luasforecasts.rpa.ie/xml/get.ashx?encrypt=false&ver=1&"
const rpaForecastURLV2 string = "http://luasforecasts.rpa.ie/xml/get.ashx?encrypt=false&ver=2&"
Loading

0 comments on commit a861a7d

Please sign in to comment.