Skip to content

A lightweight Go library that lets you easily reset and manage data in the official Firestore emulator for testing/CI.

License

Notifications You must be signed in to change notification settings

Shion1305/firestore_emutils

Repository files navigation

EMUTILS for Firestore

EMUTILS for Firestore is a small Go library designed to help you manage data in the official Firestore emulator. It’s particularly useful for integration tests or local development environments where resetting the emulator state quickly is important.

codecov

Features

  • Clear all data in your local Firestore emulator with a single call.

Usage

Import this library

go get "github.com/Shion1305/firestore_emutils"

Usage

package main

import (
    "fmt"
    "log"

    "github.com/Shion1305/firestore_emutils"
)
func main() {
    // Configure these values to match your local setup
    host := "localhost"
    port := 8080
    projectID := "my_project"

    // Create a new Emulator instance
    emu := emutils.NewEmulator(host, port, projectID)

    // Clear all data from the emulator
    if err := emu.ClearData(); err != nil {
        log.Fatalf("Failed to clear emulator data: %v", err)
    }

    fmt.Println("Firestore emulator data cleared successfully!")
}

Contributing

Contributions are always welcome! Please open a GitHub issue for bug reports or feature requests.

About

A lightweight Go library that lets you easily reset and manage data in the official Firestore emulator for testing/CI.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •