I hereby claim:
- I am wingedpig on github.
- I am wingedpig (https://keybase.io/wingedpig) on keybase.
- I have a public key whose fingerprint is 9CA1 E916 3F41 58EA 2E82 ACDA 5991 7671 8F41 E07C
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "os" | |
| "strings" | |
| "sync" | |
| "github.com/Shopify/sarama" |
| package main | |
| import ( | |
| "log" | |
| "os" | |
| "os/signal" | |
| "github.com/Shopify/sarama" | |
| ) |
| package testpage | |
| /* | |
| This is a thought experiment about a new Go-based UI framework. A project to accomplish the same thing as React or Vue.js. | |
| I strongly dislike Javascript and all the existing reactive UI frameworks. For whatever reason, and try as I might, I cannot get my head around | |
| them. Hence this thought experiment about what kind of UI framework I would like to use. | |
| == Goals == | |
| - I want to be able to build a responsive website easily. |
| // ReadConfig reads in a JSON-formatted configuration file, looking for any | |
| // include directives, and recursively reading those files as well. Include directives | |
| // are specified as a list keyed on the "Includes" key. | |
| func ReadConfig(filename string, configuration interface{}) error { | |
| // grab any path to the config file to add to the include names | |
| var prefix string | |
| slashindex := strings.LastIndex(filename, "/") | |
| if slashindex != -1 { | |
| prefix = filename[:slashindex+1] |
| { | |
| "UserDbConfig": { | |
| "URL": "user=groupsio password=dev host=127.0.0.1 dbname=userdb", | |
| "MaxIdleConnections": 1, | |
| "MaxOpenConnections": 10, | |
| "ConnMaxLifetime": 0, | |
| "Replica": false | |
| } | |
| } |
| { | |
| "Includes": [ | |
| "userdb_conf.json" | |
| ], | |
| "Port": 3000 | |
| } |
| package userdb | |
| type Config struct { | |
| URL string | |
| MaxIdleConnections int | |
| MaxOpenConnections int | |
| ConnMaxLifetime int | |
| Replica bool | |
| } |
| package main | |
| type Config struct { | |
| Includes []string | |
| UserDbConfig userdb.Config | |
| Port int | |
| } |
| package main | |
| import ( | |
| "encoding/json" | |
| "flag" | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "os" | |
| "sort" |