Documentation ¶
Overview ¶
Package firestoreutil contains test utilities for starting a firestore emulator locally.
Index ¶
- Constants
- func BatchDeleteAll(ctx context.Context, cl *firestore.Client, it *firestore.DocumentIterator) error
- func ImportData(r io.Reader, c *firestore.Client) error
- func StartEmulator(ctx context.Context) (*firestore.Client, func(), error)
- func StartTestEmulator(t *testing.T, ctx context.Context) *firestore.Client
- type Doc
Constants ¶
View Source
const FirestoreEmulatorHost = "localhost"
View Source
const FirestoreEmulatorPort = "8010"
View Source
const FirestoreEmulatorProject = "dummy-emulator-firestore-project"
Variables ¶
This section is empty.
Functions ¶
func BatchDeleteAll ¶
func BatchDeleteAll(ctx context.Context, cl *firestore.Client, it *firestore.DocumentIterator) error
BatchDeleteAll deletes all returned results in batches of sizes allowed by firestore.
func ImportData ¶
ImportData loads data into firestore from a newline-separated json doc file with objects in format:
{"p": "col/<NAME>/<SUBCOL>/<NAME>", "v": {base64 then gob-encoded map[string]interface{}} {"p": "col/<NAME>/<SUBCOL>/<NAME>", "v": {base64 then gob-encoded map[string]interface{}}
Types ¶
Click to show internal directories.
Click to hide internal directories.