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
{ | |
"events":[ | |
{ | |
"title":"the foo party", | |
"lat":1111, | |
"long":1111, | |
"description":"go to the party, surely you will have fun!", | |
"startDate":1111 // unixtimestamp | |
} | |
] |
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
- http://www.alexedwards.net/blog/golang-response-snippets | |
- https://devcharm.com/articles/8/go-nethttp-handlers/ | |
- http://openmymind.net/Things-I-Wish-Someone-Had-Told-Me-About-Go/ | |
- https://elithrar.github.io/article/custom-handlers-avoiding-globals/ | |
- https://elithrar.github.io/article/map-string-interface/ | |
- https://elithrar.github.io/article/approximating-html-template-inheritance/ | |
- http://blog.golang.org/error-handling-and-go | |
- https://golang.org/doc/articles/wiki/ | |
- https://medium.com/@benbjohnson/structuring-applications-in-go-3b04be4ff091 | |
- https://justinas.org/best-practices-for-errors-in-go/ |
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
type InitFunction func() (interface{}, error) | |
type ConnectionPoolWrapper struct { | |
size int | |
conn chan interface{} | |
} | |
/** | |
Call the init function size times. If the init function fails during any call, then | |
the creation of the pool is considered a failure. |
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 function creates a connection to the database. It shouldn't have to know anything | |
about the pool, It will be called N times where N is the size of the requested pool. | |
*/ | |
func initCirrusConnections() (interface{}, error) { | |
dbserver, _ := configFile.GetString("default", "dbserver") | |
dbuser, _ := configFile.GetString("default", "dbuser") | |
dbpass, _ := configFile.GetString("default", "dbpass") | |
db := autorc.New("tcp", "", dbserver, dbuser, dbpass) |
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
#!/bin/bash | |
# include config | |
# config example below: | |
# | |
# | |
# Example deploy_config.sh | |
# | |
# dev_env() { |