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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the publish operation, allowing for cancellation and deadlines. |
| topic | string | The topic to which the CloudEvent message will be published. |
| msg | proto.Message | The CloudEvent message to be published, represented as a protobuf message. |
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 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
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the publish operation, allowing for cancellation and deadlines. |
| topic | string | The topic to which the raw CloudEvent message 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. |