firebase

package
v0.0.0-...-75e9581 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(collection string, id string) error

Delete deletes a document with the given id in the specified collection

func GetAll

func GetAll(collection string) ([]map[string]interface{}, error)

GetAll returns all documents in the specified collection

func GetByID

func GetByID(collection string, ID string) (map[string]interface{}, error)

func GetByKeyValue

func GetByKeyValue(collection string, key string, value string) ([]map[string]interface{}, error)

func GetClient

func GetClient() *firestore.Client

GetClient uses sync.Once to ensure that the firestore client is only initialized once

func IsRunningInTestMode

func IsRunningInTestMode() bool

func UpdateOrCreate

func UpdateOrCreate(collection string, id string, data interface{}, flag ...bool) (err error)

UpdateOrCreate updates a document with the given id in the specified collection, or creates a new one if it doesn't exist

Types

This section is empty.

Jump to

Keyboard shortcuts

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