README ¶
Firebase Admin Go SDK
Table of Contents
Overview
Firebase provides the tools and infrastructure you need to develop apps, grow your user base, and earn money. The Firebase Admin Go SDK enables access to Firebase services from privileged environments (such as servers or cloud) in Go. Currently this SDK provides Firebase custom authentication support.
For more information, visit the Firebase Admin SDK setup guide.
Installation
To install Firebase Admin Go SDK, simply execute the following command
in a terminal from your $GOPATH
:
go get firebase.google.com/go
Contributing
Please refer to the CONTRIBUTING page for more information about how you can contribute to this project. We welcome bug reports, feature requests, code review feedback, and also pull requests.
Supported Go Versions
We support Go v1.9 and higher. Continuous integration system tests the code on Go v1.9 through v1.10.
Documentation
- Setup Guide
- Authentication Guide
- Cloud Firestore
- Cloud Messaging Guide
- Storage Guide
- API Reference
- Release Notes
License and Terms
Firebase Admin Go SDK is licensed under the Apache License, version 2.0.
Your use of Firebase is governed by the Terms of Service for Firebase Services.
Documentation ¶
Overview ¶
Package firebase is the entry point to the Firebase Admin SDK. It provides functionality for initializing App instances, which serve as the central entities that provide access to various other Firebase services exposed from the SDK.
Index ¶
- Constants
- type App
- func (a *App) Auth(ctx context.Context) (*auth.Client, error)
- func (a *App) Database(ctx context.Context) (*db.Client, error)
- func (a *App) DatabaseWithURL(ctx context.Context, url string) (*db.Client, error)
- func (a *App) Firestore(ctx context.Context) (*firestore.Client, error)
- func (a *App) InstanceID(ctx context.Context) (*iid.Client, error)
- func (a *App) Messaging(ctx context.Context) (*messaging.Client, error)
- func (a *App) Storage(ctx context.Context) (*storage.Client, error)
- type Config
Constants ¶
const Version = "3.8.0"
Version of the Firebase Go Admin SDK.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct {
// contains filtered or unexported fields
}
An App holds configuration and state common to all Firebase services that are exposed from the SDK.
func NewApp ¶
NewApp creates a new App from the provided config and client options.
If the client options contain a valid credential (a service account file, a refresh token file or an oauth2.TokenSource) the App will be authenticated using that credential. Otherwise, NewApp attempts to authenticate the App with Google application default credentials. If `config` is nil, the SDK will attempt to load the config options from the `FIREBASE_CONFIG` environment variable. If the value in it starts with a `{` it is parsed as a JSON object, otherwise it is assumed to be the name of the JSON file containing the options.
func (*App) Database ¶
Database returns an instance of db.Client to interact with the default Firebase Database configured via Config.DatabaseURL.
func (*App) DatabaseWithURL ¶
DatabaseWithURL returns an instance of db.Client to interact with the Firebase Database identified by the given URL.
func (*App) Firestore ¶
Firestore returns a new firestore.Client instance from the https://godoc.org/cloud.google.com/go/firestore package.
func (*App) InstanceID ¶
InstanceID returns an instance of iid.Client.
type Config ¶
type Config struct { AuthOverride *map[string]interface{} `json:"databaseAuthVariableOverride"` DatabaseURL string `json:"databaseURL"` ProjectID string `json:"projectId"` ServiceAccountID string `json:"serviceAccountId"` StorageBucket string `json:"storageBucket"` }
Config represents the configuration used to initialize an App.
Directories ¶
Path | Synopsis |
---|---|
Package auth contains functions for minting custom authentication tokens, verifying Firebase ID tokens, and managing users in a Firebase project.
|
Package auth contains functions for minting custom authentication tokens, verifying Firebase ID tokens, and managing users in a Firebase project. |
hash
Package hash contains a collection of password hash algorithms that can be used with the auth.ImportUsers() API.
|
Package hash contains a collection of password hash algorithms that can be used with the auth.ImportUsers() API. |
Package db contains functions for accessing the Firebase Realtime Database.
|
Package db contains functions for accessing the Firebase Realtime Database. |
Package iid contains functions for deleting instance IDs from Firebase projects.
|
Package iid contains functions for deleting instance IDs from Firebase projects. |
integration
|
|
Package internal contains functionality that is only accessible from within the Admin SDK.
|
Package internal contains functionality that is only accessible from within the Admin SDK. |
Package messaging contains functions for sending messages and managing device subscriptions with Firebase Cloud Messaging (FCM).
|
Package messaging contains functions for sending messages and managing device subscriptions with Firebase Cloud Messaging (FCM). |
Package storage provides functions for accessing Google Cloud Storge buckets.
|
Package storage provides functions for accessing Google Cloud Storge buckets. |