Documentation ¶
Overview ¶
Package context provides the pubsub ProtocolContext.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithProtocolContext ¶
func WithProtocolContext(ctx context.Context, tcxt ProtocolContext) context.Context
WithProtocolContext return a context with the given ProtocolContext into the provided context object.
Types ¶
type ProtocolContext ¶
type ProtocolContext struct { ID string PublishTime time.Time Project string Topic string Subscription string Method string // push or pull }
ProtocolContext allows a Receiver to understand the context of a request.
func NewProtocolContext ¶
func NewProtocolContext(project, topic, subscription, method string, msg *pubsub.Message) ProtocolContext
NewProtocolContext creates a new ProtocolContext from a pubsub.Message.
func ProtocolContextFrom ¶
func ProtocolContextFrom(ctx context.Context) ProtocolContext
ProtocolContextFrom pulls a ProtocolContext out of a context. Always returns a non-nil object.
func (ProtocolContext) String ¶
func (tx ProtocolContext) String() string
String generates a pretty-printed version of the resource as a string.
Click to show internal directories.
Click to hide internal directories.