Documentation ¶
Index ¶
- type PubSub
- func (p *PubSub) Close() error
- func (p *PubSub) CreateSubscription(id string, sid string, fltr string, cfg ...pubsub.SubscriptionConfig) error
- func (p *PubSub) CreateSubscriptions(id string, sids map[string]string, cfg ...pubsub.SubscriptionConfig) error
- func (p *PubSub) CreateTopic(id string, cfg ...pubsub.TopicConfig) error
- func (p *PubSub) Publish(id string, d any, attrs ...map[string]string) error
- func (p *PubSub) Receive(id string, mc chan<- *pubsub.Message) error
- type PubSubOptions
- func (o *PubSubOptions) SetAutoOriginatedAt(auto bool) *PubSubOptions
- func (o *PubSubOptions) SetClientOptions(opts ...option.ClientOption) *PubSubOptions
- func (o *PubSubOptions) SetProjectID(pID string) *PubSubOptions
- func (o *PubSubOptions) SetPublishSettings(s pubsub.PublishSettings) *PubSubOptions
- func (o *PubSubOptions) SetReceiveSettings(s pubsub.ReceiveSettings) *PubSubOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) CreateSubscription ¶
func (*PubSub) CreateSubscriptions ¶
func (*PubSub) CreateTopic ¶
func (p *PubSub) CreateTopic(id string, cfg ...pubsub.TopicConfig) error
type PubSubOptions ¶
type PubSubOptions struct { AutoOriginatedAt bool ProjectID string ClientOptions []option.ClientOption PublishSettings pubsub.PublishSettings ReceiveSettings pubsub.ReceiveSettings }
PubSubOptions provides a way to configure the PubSub client with various options such as the project ID, client options, and publish and receive settings.
func Options ¶
func Options(pID string, opts ...option.ClientOption) *PubSubOptions
Options returns a new PubSubOptions struct with the provided project ID and client options. The AutoOriginatedAt field is set to true by default. Any ClientOptions provided are passed directly through to the underlying pubsub.Client when calling the NewPubSub function.
func (*PubSubOptions) SetAutoOriginatedAt ¶
func (o *PubSubOptions) SetAutoOriginatedAt(auto bool) *PubSubOptions
SetAutoOriginatedAt sets the AutoOriginatedAt field on the PubSubOptions struct to the provided value and returns the modified PubSubOptions struct. If true, the OriginatedAt attribute will be set to the current time if it is not already set for all messages published.
func (*PubSubOptions) SetClientOptions ¶
func (o *PubSubOptions) SetClientOptions(opts ...option.ClientOption) *PubSubOptions
SetClientOptions sets the ClientOptions field on the PubSubOptions struct to the provided options and returns the modified PubSubOptions struct.
func (*PubSubOptions) SetProjectID ¶
func (o *PubSubOptions) SetProjectID(pID string) *PubSubOptions
SetProjectID sets the ProjectID field on the PubSubOptions struct to the provided value and returns the modified PubSubOptions struct.
func (*PubSubOptions) SetPublishSettings ¶
func (o *PubSubOptions) SetPublishSettings(s pubsub.PublishSettings) *PubSubOptions
SetPublishSettings sets the PublishSettings field on the PubSubOptions struct to the provided settings and returns the modified PubSubOptions struct.
func (*PubSubOptions) SetReceiveSettings ¶
func (o *PubSubOptions) SetReceiveSettings(s pubsub.ReceiveSettings) *PubSubOptions
SetReceiveSettings sets the ReceiveSettings field on the PubSubOptions struct to the provided settings and returns the modified PubSubOptions struct.