notifications

package
v0.0.0-...-d3da680 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package notifications contains the logic about send Swarming notifications.

Package notifications contains the logic about send Swarming notifications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendOnTaskUpdate

func SendOnTaskUpdate(ctx context.Context, tr *model.TaskRequest, trs *model.TaskResultSummary) error

SendOnTaskUpdate sends PubSub notifications for given task.

Types

type PubSubNotification

type PubSubNotification struct {
	TaskID   string `json:"task_id"`
	Userdata string `json:"userdata"`
}

PubSubNotification defines the message schema for Swarming to send the task completion PubSub message. The message attributes may contain "auth_token" if users provided it.

type PubSubNotifier

type PubSubNotifier struct {
	// contains filtered or unexported fields
}

func NewPubSubNotifier

func NewPubSubNotifier(ctx context.Context, cloudProj string) (*PubSubNotifier, error)

NewPubSubNotifier initializes a PubSubNotifier.

func (*PubSubNotifier) RegisterTQTasks

func (ps *PubSubNotifier) RegisterTQTasks(disp *tq.Dispatcher)

RegisterTQTasks registers task queue handlers.

func (*PubSubNotifier) Stop

func (ps *PubSubNotifier) Stop()

Stop properly stops the PubSubNotifier.

Directories

Path Synopsis
Package taskspb contains Cloud Tasks proto definations which will be used for sending notifications.
Package taskspb contains Cloud Tasks proto definations which will be used for sending notifications.

Jump to

Keyboard shortcuts

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