Documentation ¶
Index ¶
Constants ¶
View Source
const Scheme = "grpc"
Scheme is the URL scheme grpc pubsub registers its URLOpeners under on pubsub.DefaultMux.
Variables ¶
This section is empty.
Functions ¶
func NewSubscription ¶
func NewSubscription(path string, opts ...Option) (*pubsub.Subscription, error)
NewSubscription returns a *pubsub.Subscription representing a NATS subscription or NATS queue subscription. The subject is the NATS Subject to subscribe to; for more info, see https://nats.io/documentation/writing_applications/subjects.
Types ¶
type Publisher ¶
type Publisher interface {
Send(*pb.PublishRequest) error
}
type Subscriber ¶
type Subscriber interface {
Recv() (*pb.SubscribeResponse, error)
}
type URLOpener ¶
type URLOpener struct {
// contains filtered or unexported fields
}
URLOpener opens grpc pubsub URLs like "cells://topic".
The URL's host+path is used as the topic to create or subscribe to.
Query parameters:
- ackdeadline: The ack deadline for OpenSubscription, in time.ParseDuration formats. Defaults to 1m.
func (*URLOpener) OpenSubscriptionURL ¶
func (o *URLOpener) OpenSubscriptionURL(ctx context.Context, u *url.URL) (*pubsub.Subscription, error)
OpenSubscriptionURL opens a pubsub.Subscription based on u.
Click to show internal directories.
Click to hide internal directories.