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.
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) }
Notes ¶
- It replaces / by \ in asset names not to confilct with Firestore collection/document structure.
- Cloud FireStore share the same project's default location than Cloud Storage and App Engine.
- https://cloud.google.com/firestore/docs/locations#default-cloud-location
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 ¶
type Global ¶
type Global struct {
// contains filtered or unexported fields
}
Global structure for global variables to optimize the cloud function performances
type InstanceDeployment ¶ added in v0.0.24
type InstanceDeployment struct { DumpTimestamp time.Time `yaml:"dumpTimestamp"` Core *deploy.Core Settings Settings }
InstanceDeployment settings and artifacts structure
func NewInstanceDeployment ¶ added in v0.0.24
func NewInstanceDeployment() *InstanceDeployment
NewInstanceDeployment create deployment structure with default settings set
func (*InstanceDeployment) Deploy ¶ added in v0.0.24
func (instanceDeployment *InstanceDeployment) Deploy() (err error)
Deploy a service instance
func (*InstanceDeployment) ReadValidate ¶ added in v0.0.24
func (instanceDeployment *InstanceDeployment) ReadValidate() (err error)
ReadValidate reads and validates service and instance settings
func (*InstanceDeployment) Situate ¶ added in v0.0.24
func (instanceDeployment *InstanceDeployment) Situate()
Situate complement settings taking in account the situation for service and instance settings
type InstanceSettings ¶
InstanceSettings instance specific settings
type ServiceSettings ¶
type ServiceSettings struct { GSU gsu.Parameters GCB gcb.Parameters GCF gcf.Parameters }
ServiceSettings defines service settings common to all service instances
type Settings ¶
type Settings struct { Service ServiceSettings Instance InstanceSettings }
Settings flat settings structure: solution - service - instance