Documentation ¶
Overview ¶
Package publish2fs publish assets resource feeds as FireStore documents
It manages creation, updates and delete.
Triggered by ¶
Resource or IAM policies assets feed messages in PubSub topics.
Instances ¶
- one per asset type to be persisted in FireStore.
- ussually 3: organizations, folders and projects.
Output ¶
FireStore documents created, updated, deleted.
Cardinality ¶
One-one, one feed message - one operation performed in FireStore ¶
Automatic retrying ¶
Yes.
Required environment variables ¶
- COLLECTION_ID the name of the FireStore collection grouping all assets documents
Implementation example
package p import ( "context" "github.com/BrunoReboul/ram/services/publish2fs" "github.com/BrunoReboul/ram/utilities/ram" ) var global publish2fs.Global var ctx = context.Background() // EntryPoint is the function to be executed for each cloud function occurence func EntryPoint(ctxEvent context.Context, PubSubMessage ram.PubSubMessage) error { return publish2fs.EntryPoint(ctxEvent, PubSubMessage, &global) } func init() { publish2fs.Initialize(ctx, &global) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EntryPoint ¶
EntryPoint is the function to be executed for each cloud function occurence
func Initialize ¶
Initialize is to be executed in the init() function of the cloud function to optimize the cold start
Types ¶
Click to show internal directories.
Click to hide internal directories.