firestore

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client wraps a Google Firestore client.

func NewClient

func NewClient(projectID string) *Client

NewClient instantiates a new Firestore client for the passed GCP project.

func NewClientWithCredentials

func NewClientWithCredentials(projectID, credentialsFile string) *Client

NewClientWithCredentials instantiates a new Firestore client for the passed GCP project using the passed path to a JSON service account key file.

func (Client) DocExists

func (c Client) DocExists(id, timestamp, action string) bool

DocExists returns whether the Firestore document with the passed ID containing the passed timestamp and action exists.

func (Client) SaveDoc

func (c Client) SaveDoc(id, timestamp, action string) error

SaveDoc creates or updates the Firestore document with the passed ID, setting its contents to the passed timestamp and action.

Jump to

Keyboard shortcuts

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