pubsub

package
v0.0.0-...-a8f2654 Latest Latest
Warning

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

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

Documentation

Overview

Package pubsub implements utility functions for publishing various Run events to Cloud PubSub.

Index

Constants

This section is empty.

Variables

View Source
var File_go_chromium_org_luci_cv_internal_run_pubsub_tasks_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type PublishRunEndedTask

type PublishRunEndedTask struct {
	PublicId    string     `protobuf:"bytes,1,opt,name=public_id,json=publicId,proto3" json:"public_id,omitempty"`
	LuciProject string     `protobuf:"bytes,2,opt,name=luci_project,json=luciProject,proto3" json:"luci_project,omitempty"`
	Status      run.Status `protobuf:"varint,3,opt,name=status,proto3,enum=cv.internal.run.Status" json:"status,omitempty"`
	Eversion    int64      `protobuf:"varint,4,opt,name=eversion,proto3" json:"eversion,omitempty"`
	// contains filtered or unexported fields
}

PublishRunEndedTask publishes a PubSub message for a CV Run ended event.

func (*PublishRunEndedTask) Descriptor deprecated

func (*PublishRunEndedTask) Descriptor() ([]byte, []int)

Deprecated: Use PublishRunEndedTask.ProtoReflect.Descriptor instead.

func (*PublishRunEndedTask) GetEversion

func (x *PublishRunEndedTask) GetEversion() int64

func (*PublishRunEndedTask) GetLuciProject

func (x *PublishRunEndedTask) GetLuciProject() string

func (*PublishRunEndedTask) GetPublicId

func (x *PublishRunEndedTask) GetPublicId() string

func (*PublishRunEndedTask) GetStatus

func (x *PublishRunEndedTask) GetStatus() run.Status

func (*PublishRunEndedTask) ProtoMessage

func (*PublishRunEndedTask) ProtoMessage()

func (*PublishRunEndedTask) ProtoReflect

func (x *PublishRunEndedTask) ProtoReflect() protoreflect.Message

func (*PublishRunEndedTask) Reset

func (x *PublishRunEndedTask) Reset()

func (*PublishRunEndedTask) String

func (x *PublishRunEndedTask) String() string

func (*PublishRunEndedTask) Validate

func (m *PublishRunEndedTask) Validate() error

Validate checks the field values on PublishRunEndedTask with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.

func (*PublishRunEndedTask) ValidateAll

func (m *PublishRunEndedTask) ValidateAll() error

ValidateAll checks the field values on PublishRunEndedTask with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in PublishRunEndedTaskMultiError, or nil if none found.

type PublishRunEndedTaskMultiError

type PublishRunEndedTaskMultiError []error

PublishRunEndedTaskMultiError is an error wrapping multiple validation errors returned by PublishRunEndedTask.ValidateAll() if the designated constraints aren't met.

func (PublishRunEndedTaskMultiError) AllErrors

func (m PublishRunEndedTaskMultiError) AllErrors() []error

AllErrors returns a list of validation violation errors.

func (PublishRunEndedTaskMultiError) Error

Error returns a concatenation of all the error messages it wraps.

type PublishRunEndedTaskValidationError

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

PublishRunEndedTaskValidationError is the validation error returned by PublishRunEndedTask.Validate if the designated constraints aren't met.

func (PublishRunEndedTaskValidationError) Cause

Cause function returns cause value.

func (PublishRunEndedTaskValidationError) Error

Error satisfies the builtin error interface

func (PublishRunEndedTaskValidationError) ErrorName

ErrorName returns error name.

func (PublishRunEndedTaskValidationError) Field

Field function returns field value.

func (PublishRunEndedTaskValidationError) Key

Key function returns key value.

func (PublishRunEndedTaskValidationError) Reason

Reason function returns reason value.

type Publisher

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

Publisher publishes a message for various run events into Cloud PubSub topics.

func NewPublisher

func NewPublisher(tqd *tq.Dispatcher, env *common.Env) *Publisher

NewPublisher creates a new Publisher and registers TaskClasses for run events.

func (*Publisher) RunEnded

func (s *Publisher) RunEnded(ctx context.Context, rid common.RunID, status run.Status, eVersion int64) error

RunEnded schedules a task to publish a RunEnded message.

Jump to

Keyboard shortcuts

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