Hi All,
I recently wrote and released a v3+ Firebase Database package that uses context and uses the Google auth process with service account credentials. I believe it is significantly simpler, easier, and more idiomatic Go than the other Golang packages that are available. Is is available here:
https://github.com/knq/firebase
It can be used like the following:
db, err := firebase.NewDatabaseRef(
firebase.GoogleServiceAccountCredentialsFile("/path/to/credentials.json"),
)
if err != nil {
log.Fatal(err)
}
res := make(map[string]interface{})
err = db.Ref("/path/to/ref").Get(&res)
if err != nil {
log.Fatal(err)
}
log.Printf("received: %+v", res)
All the methods from the official clients have been implemented: Get, Push, Set, Update, Remove, as well as additional ones such as GetRulesJSON/SetRulesJSON, Listen/Watch, etc. The full GoDoc listing can be viewed here:
https://godoc.org/github.com/knq/firebase
Documentation is light at the moment, but I intend to fix that in the coming days. I will also add unit tests as soon as I have a chance.
Your comments / thoughts / criticism would be greatly appreciated. Additionally, if there is any glaring missing functionality, let me know and I'll likely add it if it makes sense to do so. Thanks!
-Ken
(ps: I will likely add supporting functionality for the other Firebase APIs at some point in the near future)