Go: github.com/knq/firebase - v3+ implementation of Firebase Database API

28 views
Skip to first unread message

Kenneth Shaw

unread,
Sep 5, 2016, 10:08:53 PM9/5/16
to Firebase Google Group
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

A more in depth example can be found here: https://github.com/knq/firebase/blob/master/example/example.go

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)

Kato Richardson

unread,
Sep 6, 2016, 3:52:33 PM9/6/16
to Firebase Google Group
Hi Ken,

Thanks for sharing this! I hope others find it useful. 

Firebase looks pretty in Go. We should have more of that. : )

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/befdd22f-e216-4fb8-b4e6-a236051f4b8a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages