Skip to content
This repository has been archived by the owner on Mar 31, 2019. It is now read-only.

Commit

Permalink
chaning Set/Remove to Auth/Unauth in alignment with other sdks
Browse files Browse the repository at this point in the history
  • Loading branch information
zabawaba99 committed Feb 5, 2015
1 parent dde5477 commit b7b20f0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions README.md
Expand Up @@ -6,7 +6,7 @@
A Firebase client written in Go

##### Under Development
The API may or may not change radically within the next upcoming weeks.
The API may or may not change radically within the next upcoming weeks.

## Installation

Expand All @@ -31,8 +31,8 @@ f := firego.New("https://my-firebase-app.firebaseIO.com")
### Auth Tokens

```go
f.SetAuth("some-token-that-was-created-for-me")
f.RemoveAuth()
f.Auth("some-token-that-was-created-for-me")
f.Unauth()
```

Visit [Fireauth](https://github.com/zabawaba99/fireauth) if you'd like to generate your own auth tokens
Expand Down Expand Up @@ -91,7 +91,7 @@ if err := f.Remove(); err != nil {
}
```

Check the [GoDocs](http://godoc.org/github.com/zabawaba99/firego) or
Check the [GoDocs](http://godoc.org/github.com/zabawaba99/firego) or
[Firebase Documentation](https://www.firebase.com/docs/rest/) for more details

## Contributing
Expand Down
4 changes: 2 additions & 2 deletions auth.go
@@ -1,11 +1,11 @@
package firego

// SetAuth sets the custom Firebase token used to authenticate to Firebase
func (fb *Firebase) SetAuth(token string) {
func (fb *Firebase) Auth(token string) {
fb.auth = token
}

// RemoveAuth removes the current token being used to authenticate to Firebase
func (fb *Firebase) RemoveAuth() {
func (fb *Firebase) Unauth() {
fb.auth = ""
}
10 changes: 5 additions & 5 deletions auth_test.go
Expand Up @@ -2,15 +2,15 @@ package firego

import "testing"

func TestSetAuth(t *testing.T) {
func TestAuth(t *testing.T) {
t.Parallel()
var (
token = "token"
server = newTestServer("")
fb = New(server.URL)
)
defer server.Close()
fb.SetAuth(token)
fb.Auth(token)
fb.Value("")
if expected, actual := 1, len(server.receivedReqs); expected != actual {
t.Fatalf("Expected: %d\nActual: %d", expected, actual)
Expand All @@ -22,16 +22,16 @@ func TestSetAuth(t *testing.T) {
}
}

func TestRemoveAuth(t *testing.T) {
func TestUnauth(t *testing.T) {
t.Parallel()
var (
token = "token"
server = newTestServer("")
fb = New(server.URL)
)
defer server.Close()
fb.SetAuth(token)
fb.RemoveAuth()
fb.Auth(token)
fb.Unauth()
fb.Value("")
if expected, actual := 1, len(server.receivedReqs); expected != actual {
t.Fatalf("Expected: %d\nActual: %d", expected, actual)
Expand Down

0 comments on commit b7b20f0

Please sign in to comment.