Skip to main content
Version: v2

Class: Topic<P>

Type parameters#

NameType
Pextends PayloadPayload

Constructors#

constructor#

• new Topic<P>()

Type parameters#

NameType
Pextends PayloadPayload

Defined in#

src/topic/index.ts:76

Properties#

options#

• options: TopicOptions = defaultOptions

Defined in#

src/topic/index.ts:73


project#

â–ª Static Optional project: GooglePubSubProject

Defined in#

src/topic/index.ts:68


topicName#

â–ª Static Readonly topicName: string

Defined in#

src/topic/index.ts:67

Methods#

publish#

â–¸ publish(message, options?): Promise<string>

Parameters#

NameType
messagePayloadInput<P>
options?TopicPublishOptions

Returns#

Promise<string>

Defined in#

src/topic/index.ts:127


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#

NameTypeDescription
messagePayloadInput<P>Message to be published

Returns#

void

Defined in#

src/topic/index.ts:99


validateTopic#

â–¸ Static validateTopic(name): void

This is run once when Topic is init to verify topic name

Parameters#

NameTypeDescription
namestringtopicName

Returns#

void

Defined in#

src/topic/index.ts:88