Skip to main content

CloudEventsSandboxOnlyPublisher

No overview available.

Methods​


Publish()​

@classmethod
def Publish(
ctx: context.Context,
topic: string,
msg: proto.Message
) - > error

Publishes a CloudEvent message to the sandbox channel. This method is used to send structured CloudEvent messages for testing purposes within a sandbox environment.

Parameters​

NameTypeDescription
ctxcontext.ContextThe context for the publish operation, allowing for cancellation and deadlines.
topicstringThe topic to which the CloudEvent message will be published.
msgproto.MessageThe CloudEvent message to be published, represented as a protobuf message.

Returns​

TypeDescription
errorAn error if the message could not be published, otherwise nil.

PublishRaw()​

@classmethod
def PublishRaw(
ctx: context.Context,
topic: string,
msgRaw: []byte
) - > error

Publishes a raw byte array as a CloudEvent message to the sandbox channel. This method is used when the CloudEvent message is already serialized into a byte array, typically for performance or specific serialization needs.

Parameters​

NameTypeDescription
ctxcontext.ContextThe context for the publish operation, allowing for cancellation and deadlines.
topicstringThe topic to which the raw CloudEvent message will be published.
msgRaw[]byteThe raw byte array representing the CloudEvent message to be published.

Returns​

TypeDescription
errorAn error if the raw message could not be published, otherwise nil.