CloudEventsSandboxOnlyPublisher
No overview available.
Methods
Publish()
@classmethod
def Publish(
ctx: context.Context,
topic: string,
msg: proto.Message
) - > error
Publishes a CloudEvent message to a topic. This method is used to send structured event data to the sandbox environment.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the publish operation, used for cancellation and deadlines. |
| topic | string | The name of the topic to which the CloudEvent will be published. |
| msg | proto.Message | The CloudEvent message, represented as a protocol buffer message, to be published. |
Returns
| Type | Description |
|---|---|
error | An 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 a topic. This method is useful for sending pre-serialized event data directly to the sandbox.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the publish operation, used for cancellation and deadlines. |
| topic | string | The name of the topic to which the raw CloudEvent will be published. |
| msgRaw | []byte | The raw byte array representing the CloudEvent message to be published. |
Returns
| Type | Description |
|---|---|
error | An error if the raw message could not be published, otherwise nil. |