Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

Latest commit

 

History

History
57 lines (42 loc) · 1.14 KB

README.md

File metadata and controls

57 lines (42 loc) · 1.14 KB

Go Firebase

Summary

Helper library for invoking the Firebase REST API.

Installation

Build

go get github.com/cosn/firebase

Test

Edit the firebase_test.go file and set the testUrl and testKey variables to match your Firebase account.

Then run:

go test github.com/cosn/firebase...

Usage

First import the package into your code:

import (
    "github.com/cosn/firebase"
)

To use the client, initialize it and make requests similarly to the Firebase docs:

firebase := new(firebase.Client)
firebase.Init("https://<TBD>.firebase.com", "<optional authentication token>", nil)

n := &Name { First: "Jack", Last: "Sparrow" }
jack, err_ := firebase.Child("users/jack", nil, nil).Set("name", n, nil)

Currently, the following methods are supported:

Child(path)
Push(value)
Set(path, value)
Update(path, value)
Remove(path)
Value()
Rules()
SetRules(rules)

For more details about this library, see the GoDoc documentation.

For more details about the Firebase APIs, see the Firebase official documentation.