firebase

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 9 Imported by: 1

Documentation

Overview

Package firebase implements functionality on top of the official firebase packages to more easily create and configure clients for firebase services.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewApp

func NewApp(config Config) (*firebase.App, error)

Returns a new App instance that can be used to obtain clients for different firebase components like Firestore or Authentication.

If the provided config is empty, will attempt to create the app using application default credentials. These are automatically available when running this code in a Google Cloud product like Compute Engine, Cloud Run or App Engine. See the comments on the type Config for more information about how to configure the app.

func NewAuthClient

func NewAuthClient(app *firebase.App) (*auth.Client, error)

Creates a new Firebase Authentication client.

func NewFirestoreClient

func NewFirestoreClient(app *firebase.App) (*firestore.Client, error)

Creates a new Firestore client.

Types

type Config

type Config struct {
	// If set to true, configures the app to use local firebase emulators.
	// The project id used by the emulators needs to be provided, either through this config or the "FIREBASE_PROJECT_ID" environment variable.
	// Note that you will also have to set an environment variable for each firebase component you want to use.
	// E.g. to use the Authentication or Firestore emulators the "FIREBASE_AUTH_EMULATOR_HOST" or "FIRESTORE_EMULATOR_HOST" environment variables
	// need to be set to the respective address the emulator is running on.
	UseEmulators bool
	ProjectId    string
	// Use this service account file to configure the app.
	ServiceAccountFile string
}

Configures how a new instance of App from package "firebase.google.com/go/v4" is created.

Directories

Path Synopsis
Package auth implements functionality to verify tokens from Firebase Authentication.
Package auth implements functionality to verify tokens from Firebase Authentication.
Package emulator provides helpers for working with firebase emulators, e.g.
Package emulator provides helpers for working with firebase emulators, e.g.
Package firestore implements helper functions and utilities to make working with package "cloud.google.com/go/firestore" easier.
Package firestore implements helper functions and utilities to make working with package "cloud.google.com/go/firestore" easier.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL