hub

package
v0.0.0-...-2ec0910 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_v1_hub_hub_proto protoreflect.FileDescriptor
View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use KV.ProtoReflect.Descriptor instead.

func (*KV) GetId

func (x *KV) GetId() int64

func (*KV) GetKey

func (x *KV) GetKey() string

func (*KV) GetMetadata

func (x *KV) GetMetadata() map[string]string

func (*KV) GetNamespace

func (x *KV) GetNamespace() string

func (*KV) GetValue

func (x *KV) GetValue() []byte

func (*KV) ProtoMessage

func (*KV) ProtoMessage()

func (*KV) ProtoReflect

func (x *KV) ProtoReflect() protoreflect.Message

func (*KV) Reset

func (x *KV) Reset()

func (*KV) String

func (x *KV) String() string

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.

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) PublishList

func (UnimplementedPubSubServiceServer) Subscribe

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.

Jump to

Keyboard shortcuts

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