eventpb

package
v0.0.0-...-9fa10a5 Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_blocky_type_event_message_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Message

type Message struct {

	// The unique identifier of the event.
	EventId string `protobuf:"bytes,1,opt,name=event_id,json=eventId,proto3" json:"event_id,omitempty"`
	// The timestamp when the event was created.
	Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	// The name of the service that created the event.
	SourceService string `protobuf:"bytes,3,opt,name=source_service,json=sourceService,proto3" json:"source_service,omitempty"`
	// Message payload of the event.
	Payload *anypb.Any `protobuf:"bytes,4,opt,name=payload,proto3" json:"payload,omitempty"`
	// An optional project resource name that states to which project this message applies.
	// For the top level messages this value is not set.
	Project string `protobuf:"bytes,5,opt,name=project,proto3" json:"project,omitempty"`
	// A metadata associated with the message.
	Metadata *structpb.Struct `protobuf:"bytes,6,opt,name=metadata,proto3" json:"metadata,omitempty"`
	// contains filtered or unexported fields
}

Message is a generic event message used for data exchange between services.

The identifier of the event is a globally unique and immutable.

The timestamp is the time relative to the service that created the event.

The source service is the name of the service that publishes the event, and should match the api package name of the service (e.g. blocky.kms for the KMS service).

func New

func New(sourceService string, msg proto.Message, metadata map[string]any) (*Message, error)

New creates a new event message.

func (*Message) Descriptor deprecated

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

Deprecated: Use Message.ProtoReflect.Descriptor instead.

func (*Message) GetEventId

func (x *Message) GetEventId() string

func (*Message) GetMetadata

func (x *Message) GetMetadata() *structpb.Struct

func (*Message) GetPayload

func (x *Message) GetPayload() *anypb.Any

func (*Message) GetProject

func (x *Message) GetProject() string

func (*Message) GetSourceService

func (x *Message) GetSourceService() string

func (*Message) GetTimestamp

func (x *Message) GetTimestamp() *timestamppb.Timestamp

func (*Message) ProtoMessage

func (*Message) ProtoMessage()

func (*Message) ProtoReflect

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

func (*Message) Reset

func (x *Message) Reset()

func (*Message) String

func (x *Message) String() string

Jump to

Keyboard shortcuts

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