Documentation ¶
Index ¶
- Variables
- func RegisterPubSubServiceServer(s grpc.ServiceRegistrar, srv PubSubServiceServer)
- type KV
- func (*KV) Descriptor() ([]byte, []int)deprecated
- func (x *KV) GetId() int64
- func (x *KV) GetKey() string
- func (x *KV) GetMetadata() map[string]string
- func (x *KV) GetNamespace() string
- func (x *KV) GetValue() []byte
- func (*KV) ProtoMessage()
- func (x *KV) ProtoReflect() protoreflect.Message
- func (x *KV) Reset()
- func (x *KV) String() string
- type PubSubServiceClient
- type PubSubServiceServer
- type PubSubService_PublishListClient
- type PubSubService_PublishListServer
- type PubSubService_SubscribeClient
- type PubSubService_SubscribeServer
- type PublishResponse
- type SubscriptionRequest
- func (*SubscriptionRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SubscriptionRequest) GetConditions() []byte
- func (x *SubscriptionRequest) GetNamespaces() []string
- func (*SubscriptionRequest) ProtoMessage()
- func (x *SubscriptionRequest) ProtoReflect() protoreflect.Message
- func (x *SubscriptionRequest) Reset()
- func (x *SubscriptionRequest) String() string
- type UnimplementedPubSubServiceServer
- type UnsafePubSubServiceServer
Constants ¶
This section is empty.
Variables ¶
var File_v1_hub_hub_proto protoreflect.FileDescriptor
var PubSubService_ServiceDesc = grpc.ServiceDesc{ ServiceName: "v1.hub.PubSubService", HandlerType: (*PubSubServiceServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Publish", Handler: _PubSubService_Publish_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Subscribe", Handler: _PubSubService_Subscribe_Handler, ServerStreams: true, }, { StreamName: "PublishList", Handler: _PubSubService_PublishList_Handler, ClientStreams: true, }, }, Metadata: "v1/hub/hub.proto", }
PubSubService_ServiceDesc is the grpc.ServiceDesc for PubSubService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterPubSubServiceServer ¶
func RegisterPubSubServiceServer(s grpc.ServiceRegistrar, srv PubSubServiceServer)
Types ¶
type KV ¶
type KV struct { Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,3,opt,name=value,proto3" json:"value,omitempty"` Metadata map[string]string `` /* 157-byte string literal not displayed */ Id int64 `protobuf:"varint,5,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
KV is an object message which get published by the client and received by the downstream subscriber.
func (*KV) Descriptor
deprecated
func (*KV) GetMetadata ¶
func (*KV) GetNamespace ¶
func (*KV) ProtoMessage ¶
func (*KV) ProtoMessage()
func (*KV) ProtoReflect ¶
func (x *KV) ProtoReflect() protoreflect.Message
type PubSubServiceClient ¶
type PubSubServiceClient interface { // Establishes a stream with the hub server for receiving KV messages. Subscribe(ctx context.Context, in *SubscriptionRequest, opts ...grpc.CallOption) (PubSubService_SubscribeClient, error) // Publish a single message to the hub. Publish(ctx context.Context, in *KV, opts ...grpc.CallOption) (*PublishResponse, error) // Publish a list of messages over a stream. PublishList(ctx context.Context, opts ...grpc.CallOption) (PubSubService_PublishListClient, error) }
PubSubServiceClient is the client API for PubSubService service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewPubSubServiceClient ¶
func NewPubSubServiceClient(cc grpc.ClientConnInterface) PubSubServiceClient
type PubSubServiceServer ¶
type PubSubServiceServer interface { // Establishes a stream with the hub server for receiving KV messages. Subscribe(*SubscriptionRequest, PubSubService_SubscribeServer) error // Publish a single message to the hub. Publish(context.Context, *KV) (*PublishResponse, error) // Publish a list of messages over a stream. PublishList(PubSubService_PublishListServer) error // contains filtered or unexported methods }
PubSubServiceServer is the server API for PubSubService service. All implementations must embed UnimplementedPubSubServiceServer for forward compatibility
type PubSubService_PublishListClient ¶
type PubSubService_PublishListClient interface { Send(*KV) error CloseAndRecv() (*PublishResponse, error) grpc.ClientStream }
type PubSubService_PublishListServer ¶
type PubSubService_PublishListServer interface { SendAndClose(*PublishResponse) error Recv() (*KV, error) grpc.ServerStream }
type PubSubService_SubscribeClient ¶
type PubSubService_SubscribeClient interface { Recv() (*KV, error) grpc.ClientStream }
type PubSubService_SubscribeServer ¶
type PubSubService_SubscribeServer interface { Send(*KV) error grpc.ServerStream }
type PublishResponse ¶
type PublishResponse struct {
// contains filtered or unexported fields
}
func (*PublishResponse) Descriptor
deprecated
func (*PublishResponse) Descriptor() ([]byte, []int)
Deprecated: Use PublishResponse.ProtoReflect.Descriptor instead.
func (*PublishResponse) ProtoMessage ¶
func (*PublishResponse) ProtoMessage()
func (*PublishResponse) ProtoReflect ¶
func (x *PublishResponse) ProtoReflect() protoreflect.Message
func (*PublishResponse) Reset ¶
func (x *PublishResponse) Reset()
func (*PublishResponse) String ¶
func (x *PublishResponse) String() string
type SubscriptionRequest ¶
type SubscriptionRequest struct { Namespaces []string `protobuf:"bytes,1,rep,name=namespaces,proto3" json:"namespaces,omitempty"` // conditions can be further used to fulfill and filter this subscription Conditions []byte `protobuf:"bytes,2,opt,name=conditions,proto3" json:"conditions,omitempty"` // contains filtered or unexported fields }
SubscriptionRequest from client to hub to receive a key published inside namespaces. Client Can also send conditions to filter these subscriptions.
func (*SubscriptionRequest) Descriptor
deprecated
func (*SubscriptionRequest) Descriptor() ([]byte, []int)
Deprecated: Use SubscriptionRequest.ProtoReflect.Descriptor instead.
func (*SubscriptionRequest) GetConditions ¶
func (x *SubscriptionRequest) GetConditions() []byte
func (*SubscriptionRequest) GetNamespaces ¶
func (x *SubscriptionRequest) GetNamespaces() []string
func (*SubscriptionRequest) ProtoMessage ¶
func (*SubscriptionRequest) ProtoMessage()
func (*SubscriptionRequest) ProtoReflect ¶
func (x *SubscriptionRequest) ProtoReflect() protoreflect.Message
func (*SubscriptionRequest) Reset ¶
func (x *SubscriptionRequest) Reset()
func (*SubscriptionRequest) String ¶
func (x *SubscriptionRequest) String() string
type UnimplementedPubSubServiceServer ¶
type UnimplementedPubSubServiceServer struct { }
UnimplementedPubSubServiceServer must be embedded to have forward compatible implementations.
func (UnimplementedPubSubServiceServer) Publish ¶
func (UnimplementedPubSubServiceServer) Publish(context.Context, *KV) (*PublishResponse, error)
func (UnimplementedPubSubServiceServer) PublishList ¶
func (UnimplementedPubSubServiceServer) PublishList(PubSubService_PublishListServer) error
func (UnimplementedPubSubServiceServer) Subscribe ¶
func (UnimplementedPubSubServiceServer) Subscribe(*SubscriptionRequest, PubSubService_SubscribeServer) error
type UnsafePubSubServiceServer ¶
type UnsafePubSubServiceServer interface {
// contains filtered or unexported methods
}
UnsafePubSubServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PubSubServiceServer will result in compilation errors.