Documentation ¶
Index ¶
Constants ¶
View Source
const TraceIDContextKey string = "trace_id"
TraceIDContextKey defines the trace id key in a context.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PubSubClient ¶
type PubSubClient[T any] struct { // contains filtered or unexported fields }
PubSubClient is a client of Google Pubsub topic with schema of type T.
func MustNewPubSubClient ¶
func MustNewPubSubClient[T any](params *PubSubClientParams[T]) *PubSubClient[T]
MustNewPubSubClient creates a new PubSubClient instance. It panics if any error is found.
func NewPubSubClient ¶
func NewPubSubClient[T any](params *PubSubClientParams[T]) (*PubSubClient[T], error)
NewPubSubClient creates a new PubSubClient instance.
func (PubSubClient[T]) Publish ¶
func (c PubSubClient[T]) Publish(ctx context.Context, in ...PublishInput[T]) []error
Publish publishes messages in a pubsub topic with schema of type T.
type PubSubClientParams ¶
PubSubClientParams encapsulates the necessary params to build a PubSubClient.
type PublishInput ¶
PublishInput is the input for publishing data into a topic with schema of type T.
Click to show internal directories.
Click to hide internal directories.