context

package
v2.0.0-RC4 Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: Apache-2.0 Imports: 4 Imported by: 2

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.

Jump to

Keyboard shortcuts

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