Version: v2
Class: Topic<P>
Type parameters#
| Name | Type |
|---|---|
P | extends PayloadPayload |
Constructors#
constructor#
• new Topic<P>()
Type parameters#
| Name | Type |
|---|---|
P | extends PayloadPayload |
Defined in#
Properties#
options#
• options: TopicOptions = defaultOptions
Defined in#
project#
â–ª Static Optional project: GooglePubSubProject
Defined in#
topicName#
â–ª Static Readonly topicName: string
Defined in#
Methods#
publish#
â–¸ publish(message, options?): Promise<string>
Parameters#
| Name | Type |
|---|---|
message | PayloadInput<P> |
options? | TopicPublishOptions |
Returns#
Promise<string>
Defined in#
validateMessage#
â–¸ validateMessage(message): void
This is run before publishing any messages, it is a no-op by default. Can overwrite to perform checks against payload before publishing
Parameters#
| Name | Type | Description |
|---|---|---|
message | PayloadInput<P> | Message to be published |
Returns#
void
Defined in#
validateTopic#
â–¸ Static validateTopic(name): void
This is run once when Topic is init to verify topic name
Parameters#
| Name | Type | Description |
|---|---|---|
name | string | topicName |
Returns#
void