context

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2020 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithTransportContext

func WithTransportContext(ctx context.Context, tcxt TransportContext) context.Context

WithTransportContext return a context with the given TransportContext into the provided context object.

Types

type TransportContext

type TransportContext struct {
	ID           string
	PublishTime  time.Time
	Project      string
	Topic        string
	Subscription string
	Method       string // push or pull
}

TransportContext allows a Receiver to understand the context of a request.

func NewTransportContext

func NewTransportContext(project, topic, subscription, method string, msg *pubsub.Message) TransportContext

NewTransportContext creates a new TransportContext from a pubsub.Message.

func TransportContextFrom

func TransportContextFrom(ctx context.Context) TransportContext

TransportContextFrom pulls a TransportContext out of a context. Always returns a non-nil object.

func (TransportContext) String

func (tx TransportContext) String() string

String generates a pretty-printed version of the resource as a string.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL