upper

package module
v0.0.0-...-4badc5a Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package upper contains a Firestore Cloud Function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeUpperCase

func MakeUpperCase(ctx context.Context, e FirestoreEvent) error

MakeUpperCase is triggered by a change to a Firestore document. It updates the `original` value of the document to upper case.

Types

type FirestoreEvent

type FirestoreEvent struct {
	OldValue   FirestoreValue `json:"oldValue"`
	Value      FirestoreValue `json:"value"`
	UpdateMask struct {
		FieldPaths []string `json:"fieldPaths"`
	} `json:"updateMask"`
}

FirestoreEvent is the payload of a Firestore event.

type FirestoreValue

type FirestoreValue struct {
	CreateTime time.Time `json:"createTime"`
	// Fields is the data for this value. The type depends on the format of your
	// database. Log an interface{} value and inspect the result to see a JSON
	// representation of your database fields.
	Fields     MyData    `json:"fields"`
	Name       string    `json:"name"`
	UpdateTime time.Time `json:"updateTime"`
}

FirestoreValue holds Firestore fields.

type MyData

type MyData struct {
	Original struct {
		StringValue string `json:"stringValue"`
	} `json:"original"`
}

MyData represents a value from Firestore. The type definition depends on the format of your database.

Jump to

Keyboard shortcuts

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