Documentation ¶
Index ¶
- func Decoder(d DecodeRequestFunc) func(e *Endpoint)
- func MaxExtension(d time.Duration) func(e *Endpoint)
- func MaxOutstandingMessages(n int) func(e *Endpoint)
- func NumGoRoutines(n int) func(e *Endpoint)
- func PopulateRequestContext(ctx context.Context, msg *pubsub.Message) context.Context
- func Synchronous(b bool) func(e *Endpoint)
- type Client
- type ClientOption
- type DecodeRequestFunc
- type EncodeRequestFunc
- type Endpoint
- type EndpointOption
- type Handler
- type Middleware
- type Transport
- func (t *Transport) Endpoint(subscriptionName string, endpoint endpoint.Endpoint, options ...EndpointOption) *Transport
- func (*Transport) LogKeys() map[string]interface{}
- func (t *Transport) Middleware(m Middleware) *Transport
- func (t *Transport) RegisterEndpoints(m endpoint.Middleware) error
- func (t *Transport) Shutdown(ctx context.Context) error
- func (t *Transport) Start(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decoder ¶
func Decoder(d DecodeRequestFunc) func(e *Endpoint)
Decoder sets the decode function for requests in the endpoint
func MaxExtension ¶
MaxExtension sets the max extension duration
func MaxOutstandingMessages ¶
MaxOutstandingMessages sets the max outstanding messages
func NumGoRoutines ¶ added in v0.0.3
NumGoRoutines sets the number of Go routines
func PopulateRequestContext ¶
PopulateRequestContext is a RequestFunc that populates several values into the context from the pub/sub message. Those values may be extracted using the corresponding ContextKey type in this package.
func Synchronous ¶ added in v0.0.3
Synchronous sets the synchronous mode
Types ¶
type Client ¶ added in v0.0.4
type Client struct {
// contains filtered or unexported fields
}
Client defines the attributes of the client
type ClientOption ¶ added in v0.0.4
type ClientOption func(*Client)
ClientOption sets an optional parameter for clients.
func EncodeRequest ¶ added in v0.0.4
func EncodeRequest(er EncodeRequestFunc) ClientOption
EncodeRequest sets the encode request function of the client
func SetClient ¶ added in v0.0.4
func SetClient(client *pubsub.Client) ClientOption
SetClient sets the pubsub client
type DecodeRequestFunc ¶
DecodeRequestFunc is a function to decode pub/sub message and return structured data
type EncodeRequestFunc ¶ added in v0.0.4
EncodeRequestFunc defines the encode request function
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint for this pubsub transport
type EndpointOption ¶
type EndpointOption func(*Endpoint)
EndpointOption is a function to set option in endpoint
type Handler ¶ added in v0.0.3
Handler is a function that processes a Pub/Sub message and returns an error
type Middleware ¶ added in v0.0.3
Middleware is a Pub/Sub middleware
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a transport that receives requests from PubSub
func NewTransport ¶
NewTransport creates a new Transport for the related Google Cloud Project
func (*Transport) Endpoint ¶
func (t *Transport) Endpoint(subscriptionName string, endpoint endpoint.Endpoint, options ...EndpointOption) *Transport
Endpoint creates a new Endpoint
func (*Transport) Middleware ¶ added in v0.0.3
func (t *Transport) Middleware(m Middleware) *Transport
Middleware sets a Pub/Sub middleware for all endpoint handlers
func (*Transport) RegisterEndpoints ¶
func (t *Transport) RegisterEndpoints(m endpoint.Middleware) error
RegisterEndpoints registers a middleware to all registered endpoints at that time