Documentation
¶
Overview ¶
Package grpc is a generated protocol buffer package.
It is generated from these files:
server.proto
It has these top-level messages:
PublishRequest PublishResponse SubscribeRequest SubscribeResponse AckRequest AckResponse
Index ¶
- func NewPublisher(topic string, conn *grpc.ClientConn) pubsub.Publisher
- func NewSubscriber(topic, subscriptionID string, conn *grpc.ClientConn) pubsub.Subscriber
- func RegisterPubSubServer(s *grpc1.Server, srv PubSubServer)
- type AckRequest
- type AckResponse
- type ErrorHandler
- type PubSubClient
- type PubSubServer
- type PubSub_SubscribeClient
- type PubSub_SubscribeServer
- type PublishRequest
- func (*PublishRequest) Descriptor() ([]byte, []int)
- func (m *PublishRequest) GetMessage() []byte
- func (m *PublishRequest) GetMetadata() map[string]string
- func (m *PublishRequest) GetTopic() string
- func (*PublishRequest) ProtoMessage()
- func (m *PublishRequest) Reset()
- func (m *PublishRequest) String() string
- type PublishResponse
- type PublisherFactory
- type SubscribeRequest
- func (*SubscribeRequest) Descriptor() ([]byte, []int)
- func (m *SubscribeRequest) GetFilter() map[string]string
- func (m *SubscribeRequest) GetRetentionPeriod() *google_protobuf.UInt64Value
- func (m *SubscribeRequest) GetSubscriptionId() string
- func (m *SubscribeRequest) GetTopic() string
- func (m *SubscribeRequest) GetVisibilityTimeout() *google_protobuf.UInt64Value
- func (*SubscribeRequest) ProtoMessage()
- func (m *SubscribeRequest) Reset()
- func (m *SubscribeRequest) String() string
- type SubscribeResponse
- func (*SubscribeResponse) Descriptor() ([]byte, []int)
- func (m *SubscribeResponse) GetMessage() []byte
- func (m *SubscribeResponse) GetMessageId() string
- func (m *SubscribeResponse) GetMetadata() map[string]string
- func (*SubscribeResponse) ProtoMessage()
- func (m *SubscribeResponse) Reset()
- func (m *SubscribeResponse) String() string
- type SubscriberFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPublisher ¶
func NewPublisher(topic string, conn *grpc.ClientConn) pubsub.Publisher
NewPublisher returns an implementation of pubsub.Publisher from the given grpc connection. This is a convenience in case you want to operate with go channels instead of interacting with the client directly
func NewSubscriber ¶
func NewSubscriber(topic, subscriptionID string, conn *grpc.ClientConn) pubsub.Subscriber
NewSubscriber returns an implementation of pubsub.Subscriber from the given grpc connection. This is a convenience in case you want to operate with go channels instead of interacting with the client directly
func RegisterPubSubServer ¶
func RegisterPubSubServer(s *grpc1.Server, srv PubSubServer)
Types ¶
type AckRequest ¶
type AckRequest struct { Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` SubscriptionId string `protobuf:"bytes,2,opt,name=subscription_id,json=subscriptionId" json:"subscription_id,omitempty"` MessageId string `protobuf:"bytes,3,opt,name=message_id,json=messageId" json:"message_id,omitempty"` }
func (*AckRequest) Descriptor ¶
func (*AckRequest) Descriptor() ([]byte, []int)
func (*AckRequest) GetMessageId ¶
func (m *AckRequest) GetMessageId() string
func (*AckRequest) GetSubscriptionId ¶
func (m *AckRequest) GetSubscriptionId() string
func (*AckRequest) GetTopic ¶
func (m *AckRequest) GetTopic() string
func (*AckRequest) ProtoMessage ¶
func (*AckRequest) ProtoMessage()
func (*AckRequest) Reset ¶
func (m *AckRequest) Reset()
func (*AckRequest) String ¶
func (m *AckRequest) String() string
type AckResponse ¶
type AckResponse struct { }
func (*AckResponse) Descriptor ¶
func (*AckResponse) Descriptor() ([]byte, []int)
func (*AckResponse) ProtoMessage ¶
func (*AckResponse) ProtoMessage()
func (*AckResponse) Reset ¶
func (m *AckResponse) Reset()
func (*AckResponse) String ¶
func (m *AckResponse) String() string
type ErrorHandler ¶
type ErrorHandler func(error)
ErrorHandler allows handling any errors that come during subscription, like logging it or terminating early
type PubSubClient ¶
type PubSubClient interface { Publish(ctx context.Context, in *PublishRequest, opts ...grpc1.CallOption) (*PublishResponse, error) Subscribe(ctx context.Context, in *SubscribeRequest, opts ...grpc1.CallOption) (PubSub_SubscribeClient, error) Ack(ctx context.Context, in *AckRequest, opts ...grpc1.CallOption) (*AckResponse, error) }
func NewPubSubClient ¶
func NewPubSubClient(cc *grpc1.ClientConn) PubSubClient
type PubSubServer ¶
type PubSubServer interface { Publish(context.Context, *PublishRequest) (*PublishResponse, error) Subscribe(*SubscribeRequest, PubSub_SubscribeServer) error Ack(context.Context, *AckRequest) (*AckResponse, error) }
func NewPubSubServer ¶
func NewPubSubServer(publisherFactory PublisherFactory, subscriberFactory SubscriberFactory) PubSubServer
NewPubSubServer returns an implementation of PubSubServer by consuming a pubsub.Publisher and pubsub.OnceSubscriber implementation
type PubSub_SubscribeClient ¶
type PubSub_SubscribeClient interface { Recv() (*SubscribeResponse, error) grpc1.ClientStream }
type PubSub_SubscribeServer ¶
type PubSub_SubscribeServer interface { Send(*SubscribeResponse) error grpc1.ServerStream }
type PublishRequest ¶
type PublishRequest struct { Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` Message []byte `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Metadata map[string]string `` /* 136-byte string literal not displayed */ }
func (*PublishRequest) Descriptor ¶
func (*PublishRequest) Descriptor() ([]byte, []int)
func (*PublishRequest) GetMessage ¶
func (m *PublishRequest) GetMessage() []byte
func (*PublishRequest) GetMetadata ¶
func (m *PublishRequest) GetMetadata() map[string]string
func (*PublishRequest) GetTopic ¶
func (m *PublishRequest) GetTopic() string
func (*PublishRequest) ProtoMessage ¶
func (*PublishRequest) ProtoMessage()
func (*PublishRequest) Reset ¶
func (m *PublishRequest) Reset()
func (*PublishRequest) String ¶
func (m *PublishRequest) String() string
type PublishResponse ¶
type PublishResponse struct { }
func (*PublishResponse) Descriptor ¶
func (*PublishResponse) Descriptor() ([]byte, []int)
func (*PublishResponse) ProtoMessage ¶
func (*PublishResponse) ProtoMessage()
func (*PublishResponse) Reset ¶
func (m *PublishResponse) Reset()
func (*PublishResponse) String ¶
func (m *PublishResponse) String() string
type PublisherFactory ¶
PublisherFactory is a simple function wrapper for creating a pubsub.Publisher instance
type SubscribeRequest ¶
type SubscribeRequest struct { Topic string `protobuf:"bytes,1,opt,name=topic" json:"topic,omitempty"` SubscriptionId string `protobuf:"bytes,2,opt,name=subscription_id,json=subscriptionId" json:"subscription_id,omitempty"` Filter map[string]string `` /* 132-byte string literal not displayed */ RetentionPeriod *google_protobuf.UInt64Value `protobuf:"bytes,4,opt,name=retention_period,json=retentionPeriod" json:"retention_period,omitempty"` VisibilityTimeout *google_protobuf.UInt64Value `protobuf:"bytes,5,opt,name=visibility_timeout,json=visibilityTimeout" json:"visibility_timeout,omitempty"` }
func (*SubscribeRequest) Descriptor ¶
func (*SubscribeRequest) Descriptor() ([]byte, []int)
func (*SubscribeRequest) GetFilter ¶
func (m *SubscribeRequest) GetFilter() map[string]string
func (*SubscribeRequest) GetRetentionPeriod ¶ added in v0.2.1
func (m *SubscribeRequest) GetRetentionPeriod() *google_protobuf.UInt64Value
func (*SubscribeRequest) GetSubscriptionId ¶
func (m *SubscribeRequest) GetSubscriptionId() string
func (*SubscribeRequest) GetTopic ¶
func (m *SubscribeRequest) GetTopic() string
func (*SubscribeRequest) GetVisibilityTimeout ¶ added in v0.2.1
func (m *SubscribeRequest) GetVisibilityTimeout() *google_protobuf.UInt64Value
func (*SubscribeRequest) ProtoMessage ¶
func (*SubscribeRequest) ProtoMessage()
func (*SubscribeRequest) Reset ¶
func (m *SubscribeRequest) Reset()
func (*SubscribeRequest) String ¶
func (m *SubscribeRequest) String() string
type SubscribeResponse ¶
type SubscribeResponse struct { MessageId string `protobuf:"bytes,1,opt,name=message_id,json=messageId" json:"message_id,omitempty"` Message []byte `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` Metadata map[string]string `` /* 136-byte string literal not displayed */ }
func (*SubscribeResponse) Descriptor ¶
func (*SubscribeResponse) Descriptor() ([]byte, []int)
func (*SubscribeResponse) GetMessage ¶
func (m *SubscribeResponse) GetMessage() []byte
func (*SubscribeResponse) GetMessageId ¶
func (m *SubscribeResponse) GetMessageId() string
func (*SubscribeResponse) GetMetadata ¶
func (m *SubscribeResponse) GetMetadata() map[string]string
func (*SubscribeResponse) ProtoMessage ¶
func (*SubscribeResponse) ProtoMessage()
func (*SubscribeResponse) Reset ¶
func (m *SubscribeResponse) Reset()
func (*SubscribeResponse) String ¶
func (m *SubscribeResponse) String() string
type SubscriberFactory ¶
SubscriberFactory is a simple function wrapper for creating a pubsub.Subscriber instance