Documentation ¶
Overview ¶
Package events provides a lightweight set of methods which Builders could use to publish events.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶ added in v0.2.0
type Client struct {
// contains filtered or unexported fields
}
Client object to manage Publishing to a Pub/Sub topic.
func New ¶
New creates a new instance of the Client object.
Example ¶
ctx := context.Background() // Create a new pubsubClient client, _ := New("your-google-project", &Options{Topic: "my-topic"}) // Publish a message as the event. var message proto.Message // The message would typically be one of the autogenerated messages, say pb.Portfolio{} _ = client.Publish(ctx, message, &PublishOptions{})
Output:
func (*Client) BatchPublish ¶ added in v0.3.0
type Options ¶
type Options struct { // The Pub/Sub Topic // For example: 'events' // // Defaults to 'events' if not specified. Topic string }
Options for the New method.
type PublishOptions ¶
type PublishOptions struct { // OrderingKey identifies related messages for which publish order should be respected. If empty string is used, // message will be sent unordered. OrderingKey string }
PublishOptions used when publishing using the Client.Publish method.
Click to show internal directories.
Click to hide internal directories.