import "firebase.google.com/go"
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.
const Version = "4.1.0"
Version of the Firebase Go Admin SDK.
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.
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.
Auth returns an instance of auth.Client.
Database returns an instance of db.Client to interact with the default Firebase Database configured via Config.DatabaseURL.
DatabaseWithURL returns an instance of db.Client to interact with the Firebase Database identified by the given URL.
Firestore returns a new firestore.Client instance from the https://godoc.org/cloud.google.com/go/firestore package.
InstanceID returns an instance of iid.Client.
Messaging returns an instance of messaging.Client.
Storage returns a new instance of storage.Client.
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.
Path | Synopsis |
---|---|
auth | Package auth contains functions for minting custom authentication tokens, verifying Firebase ID tokens, and managing users in a Firebase project. |
db | Package db contains functions for accessing the Firebase Realtime Database. |
errorutils | Package errorutils provides functions for checking and handling error conditions. |
iid | Package iid contains functions for deleting instance IDs from Firebase projects. |
internal | Package internal contains functionality that is only accessible from within the Admin SDK. |
messaging | Package messaging contains functions for sending messages and managing device subscriptions with Firebase Cloud Messaging (FCM). |
storage | Package storage provides functions for accessing Google Cloud Storge buckets. |
Package firebase imports 14 packages (graph) and is imported by 59 packages. Updated 2020-12-15. Refresh now. Tools for package owners.