functions

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: MIT Imports: 3 Imported by: 0

README

functions

Utilities and helpers for apps running in Google Cloud Functions.

Install

go get github.com/altipla-consulting/functions

Usage

Receive a Firestore Event:

package foo

import (
  "context"
  "fmt"

  "github.com/altipla-consulting/functions"
)

func Entrypoint(ctx context.Context, event *functions.FirestoreEvent) error {
  fmt.Printf("%#v\n", event.OldValue)
  fmt.Printf("%#v\n", event.Value)

  return nil
}

Contributing

You can make pull requests or create issues in GitHub. Any code you send should be formatted using make gofmt.

Running tests

Run the tests:

make test

License

MIT License

Documentation

Overview

Package functions contains utilities and helpers for apps running in Google Cloud Functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document pb.Document

Document wraps the native Firestore document to help with the JSON unmarshal in Cloud Functions.

func (*Document) UnmarshalJSON

func (doc *Document) UnmarshalJSON(content []byte) error

UnmarshalJSON implements the custom unmarshal from JSON of the document using jsonpb instead of the normal JSON procedures.

type FirestoreEvent

type FirestoreEvent struct {
	OldValue   *Document
	Value      *Document
	UpdateMask *pb.DocumentMask
}

FirestoreEvent is received as an argument in functions invoked by Firestore events.

Jump to

Keyboard shortcuts

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