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
- func CloudAuditLogsEventID(id, logName, timestamp string) string
- func CloudAuditLogsEventSource(parentResource, activity string) string
- func CloudAuditLogsEventSubject(serviceName, resourceName string) string
- func CloudBuildSourceEventSource(googleCloudProject, buildId string) string
- func CloudPubSubEventSource(googleCloudProject, topic string) string
- func CloudSchedulerEventSource(jobName string) string
- func CloudStorageEventSource(bucket string) string
- func CloudStorageEventSubject(object string) string
- type PubSubMessage
- type PushMessage
- type SchedulerJobData
Constants ¶
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" )
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" )
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" )
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" )
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 ¶
CloudAuditLogsEventID returns the Cloud Audit Logs CloudEvent id value.
func CloudAuditLogsEventSource ¶
CloudAuditLogsEventSource returns the Cloud Audit Logs CloudEvent source value. Format e.g. //cloudaudit.googleapis.com/projects/project-id/logs/[activity|data_access]
func CloudAuditLogsEventSubject ¶
CloudAuditLogsEventSubject returns the Cloud Audit Logs CloudEvent subject value.
func CloudBuildSourceEventSource ¶
CloudBuildSourceEventSource returns the Cloud Build CloudEvent source value.
func CloudPubSubEventSource ¶
CloudPubSubEventSource returns the Cloud Pub/Sub CloudEvent source value.
func CloudStorageEventSource ¶
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"`
}