schema

package
v0.0.0-...-628cd94 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: GPL-3.0 Imports: 0 Imported by: 7

README

SelfDoc

Auto-generated code documentation to make the repository easier to navigate and contribute to.

Last Updated: 2023-05-15

The schema directory is for defining structs and constants used as payloads for different types of events in the SRC pub/sub system. The schema.go file contains definitions for MessagePublishedData, PubSubMessage, EmailPushNotification, EmailMessages, EmailMessagesSettings, EmailLabelChange, and EmailLabelChanges, as well as constants EmailLabelChangeTypeAdded and EmailLabelChangeTypeRemoved.

Files

schema.go

This file defines several structs used as payloads for different types of events in the SRC pub/sub system, including MessagePublishedData, PubSubMessage, EmailPushNotification, EmailMessages, EmailMessagesSettings, EmailLabelChange, and EmailLabelChanges. It also defines constants EmailLabelChangeTypeAdded and EmailLabelChangeTypeRemoved.

Documentation

Index

Constants

View Source
const EmailLabelChangeTypeAdded = "added"

EmailLabelChangeTypeAdded indicates a label was added to a message

View Source
const EmailLabelChangeTypeRemoved = "removed"

EmailLabelChangeTypeRemoved indicates a label was removed from a message

Variables

This section is empty.

Functions

This section is empty.

Types

type EmailLabelChange

type EmailLabelChange struct {
	MessageID  string   `json:"message_id"`
	LabelIDs   []string `json:"label_ids"`
	ChangeType string   `json:"change_type"`
}

EmailLabelChange is the payload for a label change event

type EmailLabelChanges

type EmailLabelChanges struct {
	// Email is the email address of the user.
	Email string `json:"email"`
	// Changes is the list of label changes.
	Changes []EmailLabelChange `json:"changes"`
}

type EmailMessages

type EmailMessages struct {
	// Email is the email address of the user.
	Email string `json:"email"`
	// Messages is the list of messages IDs.
	Messages []string `json:"messages"`
	// Settings allow us to configure the downstream processing behavior
	Settings EmailMessagesSettings `json:"settings"`
}

EmailMessages is the payload for messages to be processes

type EmailMessagesSettings

type EmailMessagesSettings struct {
	// DryRun indicates whether we should take action on the messages or not.
	DryRun bool `json:"dry_run"`
	// Reclassify indicates whether we should reclassify already classified messages or not.
	Reclassify bool `json:"reclassify"`
}

type EmailPushNotification

type EmailPushNotification struct {
	Email     string `json:"emailAddress"`
	HistoryID uint64 `json:"historyId"`
}

EmailPushNotification is the payload of a gmail push notification event. Note the fields are camelCase, not snake_case, because Google generates them.

type MessagePublishedData

type MessagePublishedData struct {
	Message PubSubMessage
}

MessagePublishedData contains the full Pub/Sub message See the documentation for more details: https://cloud.google.com/eventarc/docs/cloudevents#pubsub

type PubSubMessage

type PubSubMessage struct {
	// Data is the message payload.
	Data []byte `json:"data"`
}

PubSubMessage is the payload of a Pub/Sub event. See the documentation for more details: https://cloud.google.com/pubsub/docs/reference/rest/v1/PubsubMessage

Jump to

Keyboard shortcuts

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