v1

package
v0.0.0-...-d19fc40 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package v1 defines constants and util functions for event v1 schemas. TODO: Later most of the constants should be available in the Go package generated from https://github.com/googleapis/google-cloudevents. We should use that instead.

Index

Constants

View Source
const (
	CloudAuditLogsLogWrittenEventType = "google.cloud.audit.log.v1.written"
	CloudAuditLogsEventDataSchema     = "https://raw.githubusercontent.com/googleapis/google-cloudevents/master/proto/google/events/cloud/audit/v1/data.proto"

	ServiceNameExtension  = "servicename"
	MethodNameExtension   = "methodname"
	ResourceNameExtension = "resourcename"
)
View Source
const (
	// CloudBuildSource CloudEvent type
	CloudBuildSourceEventType = "google.cloud.cloudbuild.build.v1.statusChanged"
	// CloudBuildSourceBuildId is the Pub/Sub message attribute key with the CloudBuildSource's buildId.
	CloudBuildSourceBuildId = "buildId"
	// CloudBuildSourceBuildStatus is the Pub/Sub message attribute key with the CloudBuildSource's build status.
	CloudBuildSourceBuildStatus = "status"
)
View Source
const (
	CloudPubSubMessagePublishedEventType = "google.cloud.pubsub.topic.v1.messagePublished"
	CloudPubSubEventDataSchema           = "https://raw.githubusercontent.com/googleapis/google-cloudevents/master/proto/google/events/cloud/pubsub/v1/data.proto"
)
View Source
const (
	CloudSchedulerJobExecutedEventType = "google.cloud.scheduler.job.v1.executed"
	CloudSchedulerEventDataSchema      = "https://raw.githubusercontent.com/googleapis/google-cloudevents/master/proto/google/events/cloud/scheduler/v1/data.proto"
)
View Source
const (
	CloudStorageObjectFinalizedEventType       = "google.cloud.storage.object.v1.finalized"
	CloudStorageObjectArchivedEventType        = "google.cloud.storage.object.v1.archived"
	CloudStorageObjectDeletedEventType         = "google.cloud.storage.object.v1.deleted"
	CloudStorageObjectMetadataUpdatedEventType = "google.cloud.storage.object.v1.metadataUpdated"
	CloudStorageEventDataSchema                = "https://raw.githubusercontent.com/googleapis/google-cloudevents/master/proto/google/events/cloud/storage/v1/data.proto"
)

Variables

This section is empty.

Functions

func CloudAuditLogsEventID

func CloudAuditLogsEventID(id, logName, timestamp string) string

CloudAuditLogsEventID returns the Cloud Audit Logs CloudEvent id value.

func CloudAuditLogsEventSource

func CloudAuditLogsEventSource(parentResource, activity string) string

CloudAuditLogsEventSource returns the Cloud Audit Logs CloudEvent source value. Format e.g. //cloudaudit.googleapis.com/projects/project-id/logs/[activity|data_access]

func CloudAuditLogsEventSubject

func CloudAuditLogsEventSubject(serviceName, resourceName string) string

CloudAuditLogsEventSubject returns the Cloud Audit Logs CloudEvent subject value.

func CloudBuildSourceEventSource

func CloudBuildSourceEventSource(googleCloudProject, buildId string) string

CloudBuildSourceEventSource returns the Cloud Build CloudEvent source value.

func CloudPubSubEventSource

func CloudPubSubEventSource(googleCloudProject, topic string) string

CloudPubSubEventSource returns the Cloud Pub/Sub CloudEvent source value.

func CloudSchedulerEventSource

func CloudSchedulerEventSource(jobName string) string

func CloudStorageEventSource

func CloudStorageEventSource(bucket string) string

func CloudStorageEventSubject

func CloudStorageEventSubject(object string) string

Types

type PubSubMessage

type PubSubMessage struct {
	// ID identifies this message. This ID is assigned by the server and is
	// populated for Messages obtained from a subscription.
	// This field is read-only.
	ID string `json:"messageId,omitempty"`

	// Data is the actual data in the message.
	Data interface{} `json:"data,omitempty"`

	// Attributes represents the key-value pairs the current message
	// is labelled with.
	Attributes map[string]string `json:"attributes,omitempty"`

	// The time at which the message was published. This is populated by the
	// server for Messages obtained from a subscription.
	// This field is read-only.
	PublishTime time.Time `json:"publishTime,omitempty"`
}

PubSubMessage matches the inner message format used by Push Subscriptions.

type PushMessage

type PushMessage struct {
	// Subscription is the subscription ID that received this Message.
	Subscription string `json:"subscription"`
	// Message holds the Pub/Sub message contents.
	Message *PubSubMessage `json:"message,omitempty"`
}

PushMessage represents the format Pub/Sub uses to push events.

type SchedulerJobData

type SchedulerJobData struct {
	CustomData []byte `json:"custom_data,omitempty"`
}

Jump to

Keyboard shortcuts

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