convertlog2feed

package
v0.4.5-rc01 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Overview

Package convertlog2feed convert log entry messsage from pubsub into feed compatible format pubusub message

Instances

Some.

At least one to convert gsuite admin logs, related to groups members and groups settings, from GCP Cloud Audit Logs at organization level.

Output

Publish pubsub message into several topics, e.g. gci-grouMembers and gci-groupSettings.

Cardinality

One one: one log message one feed message.

Notes

- AdminSDK activity logs do not reference the group ID only the email, that is a mutable attribute. A cache in firestore is used to handle this.

- Each message is a base64-encoded LogEntry object https://cloud.google.com/logging/docs/export/using_exported_logs#pubsub-overview .

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntryPoint

func EntryPoint(ctxEvent context.Context, PubSubMessage gps.PubSubMessage, global *Global) error

EntryPoint is the function to be executed for each cloud function occurence

func Initialize

func Initialize(ctx context.Context, global *Global) (err error)

Initialize is to be executed in the init() function of the cloud function to optimize the cold start

Types

type Global

type Global struct {
	GCIGroupMembersTopicName  string
	GCIGroupSettingsTopicName string

	PubSubID string
	// contains filtered or unexported fields
}

Global structure for global variables to optimize the cloud function performances

type InstanceDeployment

type InstanceDeployment struct {
	DumpTimestamp time.Time `yaml:"dumpTimestamp"`
	Core          *deploy.Core
	Settings      struct {
		Service struct {
			GSU             gsu.Parameters
			IAM             iamgt.Parameters
			GCB             gcb.Parameters
			GCF             gcf.Parameters
			KeyJSONFileName string        `yaml:"keyJSONFileName"`
			RetriesNumber   time.Duration `yaml:"time.Duration"`
		}
		Instance struct {
			GCF gcf.Event
			GCI struct {
				SuperAdminEmail string `yaml:"superAdminEmail"`
			}
		}
	}
}

InstanceDeployment settings and artifacts structure

func NewInstanceDeployment

func NewInstanceDeployment() *InstanceDeployment

NewInstanceDeployment create deployment structure with default settings set

func (*InstanceDeployment) Deploy

func (instanceDeployment *InstanceDeployment) Deploy() (err error)

Deploy a service instance

func (*InstanceDeployment) ReadValidate

func (instanceDeployment *InstanceDeployment) ReadValidate() (err error)

ReadValidate reads and validates service and instance settings

func (*InstanceDeployment) Situate

func (instanceDeployment *InstanceDeployment) Situate() (err error)

Situate complement settings taking in account the situation for service and instance settings

Jump to

Keyboard shortcuts

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