Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterClusterServer(s grpc.ServiceRegistrar, srv ClusterServer)
- type Ack
- type Cluster
- type ClusterClient
- type ClusterServer
- type Cluster_SyncClient
- type Cluster_SyncServer
- type Event
- func (*Event) Descriptor() ([]byte, []int)deprecated
- func (m *Event) GetEvent() isEvent_Event
- func (x *Event) GetId() uint64
- func (x *Event) GetMessage() *Message
- func (x *Event) GetSubscribe() *Subscribe
- func (x *Event) GetUnsubscribe() *Unsubscribe
- func (*Event) ProtoMessage()
- func (x *Event) ProtoReflect() protoreflect.Message
- func (x *Event) Reset()
- func (x *Event) String() string
- type Event_Message
- type Event_Subscribe
- type Event_Unsubscribe
- type Message
- type PingReq
- type PingRsp
- type Subscribe
- type UnimplementedClusterServer
- type UnsafeClusterServer
- type Unsubscribe
Constants ¶
const ( Cluster_Ping_FullMethodName = "/Cluster/Ping" Cluster_Sync_FullMethodName = "/Cluster/Sync" )
Variables ¶
var Cluster_ServiceDesc = grpc.ServiceDesc{ ServiceName: "Cluster", HandlerType: (*ClusterServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Ping", Handler: _Cluster_Ping_Handler, }, }, Streams: []grpc.StreamDesc{ { StreamName: "Sync", Handler: _Cluster_Sync_Handler, ServerStreams: true, ClientStreams: true, }, }, Metadata: "plugin/cluster/proto/cluster.proto", }
Cluster_ServiceDesc is the grpc.ServiceDesc for Cluster service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
var File_plugin_cluster_proto_cluster_proto protoreflect.FileDescriptor
Functions ¶
func RegisterClusterServer ¶
func RegisterClusterServer(s grpc.ServiceRegistrar, srv ClusterServer)
Types ¶
type Ack ¶
type Ack struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // contains filtered or unexported fields }
func (*Ack) Descriptor
deprecated
func (*Ack) ProtoMessage ¶
func (*Ack) ProtoMessage()
func (*Ack) ProtoReflect ¶
func (x *Ack) ProtoReflect() protoreflect.Message
type Cluster ¶
type Cluster struct { Peers *sync.Map UnimplementedClusterServer // contains filtered or unexported fields }
func (*Cluster) Sync ¶
func (c *Cluster) Sync(stream Cluster_SyncServer) error
func (*Cluster) SyncHandler ¶
type ClusterClient ¶
type ClusterClient interface { Ping(ctx context.Context, in *PingReq, opts ...grpc.CallOption) (*PingRsp, error) Sync(ctx context.Context, opts ...grpc.CallOption) (Cluster_SyncClient, error) }
ClusterClient is the client API for Cluster 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 NewClusterClient ¶
func NewClusterClient(cc grpc.ClientConnInterface) ClusterClient
type ClusterServer ¶
type ClusterServer interface { Ping(context.Context, *PingReq) (*PingRsp, error) Sync(Cluster_SyncServer) error // contains filtered or unexported methods }
ClusterServer is the server API for Cluster service. All implementations must embed UnimplementedClusterServer for forward compatibility
type Cluster_SyncClient ¶
type Cluster_SyncServer ¶
type Event ¶
type Event struct { Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // Types that are assignable to Event: // // *Event_Subscribe // *Event_Message // *Event_Unsubscribe Event isEvent_Event `protobuf_oneof:"event"` // contains filtered or unexported fields }
func (*Event) Descriptor
deprecated
func (*Event) GetMessage ¶
func (*Event) GetSubscribe ¶
func (*Event) GetUnsubscribe ¶
func (x *Event) GetUnsubscribe() *Unsubscribe
func (*Event) ProtoMessage ¶
func (*Event) ProtoMessage()
func (*Event) ProtoReflect ¶
func (x *Event) ProtoReflect() protoreflect.Message
type Event_Message ¶
type Event_Message struct {
Message *Message `protobuf:"bytes,3,opt,name=message,proto3,oneof"`
}
type Event_Subscribe ¶
type Event_Subscribe struct {
Subscribe *Subscribe `protobuf:"bytes,2,opt,name=subscribe,proto3,oneof"`
}
type Event_Unsubscribe ¶
type Event_Unsubscribe struct {
Unsubscribe *Unsubscribe `protobuf:"bytes,4,opt,name=unsubscribe,proto3,oneof"`
}
type Message ¶
type Message struct { Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // contains filtered or unexported fields }
func (*Message) Descriptor
deprecated
func (*Message) GetPayload ¶
func (*Message) ProtoMessage ¶
func (*Message) ProtoMessage()
func (*Message) ProtoReflect ¶
func (x *Message) ProtoReflect() protoreflect.Message
type PingReq ¶
type PingReq struct { SessionId string `protobuf:"bytes,1,opt,name=sessionId,proto3" json:"sessionId,omitempty"` // contains filtered or unexported fields }
func (*PingReq) Descriptor
deprecated
func (*PingReq) GetSessionId ¶
func (*PingReq) ProtoMessage ¶
func (*PingReq) ProtoMessage()
func (*PingReq) ProtoReflect ¶
func (x *PingReq) ProtoReflect() protoreflect.Message
type PingRsp ¶
type PingRsp struct { Restart bool `protobuf:"varint,1,opt,name=restart,proto3" json:"restart,omitempty"` NextId uint64 `protobuf:"varint,2,opt,name=nextId,proto3" json:"nextId,omitempty"` // contains filtered or unexported fields }
func (*PingRsp) Descriptor
deprecated
func (*PingRsp) GetRestart ¶
func (*PingRsp) ProtoMessage ¶
func (*PingRsp) ProtoMessage()
func (*PingRsp) ProtoReflect ¶
func (x *PingRsp) ProtoReflect() protoreflect.Message
type Subscribe ¶
type Subscribe struct { Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` // contains filtered or unexported fields }
func (*Subscribe) Descriptor
deprecated
func (*Subscribe) ProtoMessage ¶
func (*Subscribe) ProtoMessage()
func (*Subscribe) ProtoReflect ¶
func (x *Subscribe) ProtoReflect() protoreflect.Message
type UnimplementedClusterServer ¶
type UnimplementedClusterServer struct { }
UnimplementedClusterServer must be embedded to have forward compatible implementations.
func (UnimplementedClusterServer) Sync ¶
func (UnimplementedClusterServer) Sync(Cluster_SyncServer) error
type UnsafeClusterServer ¶
type UnsafeClusterServer interface {
// contains filtered or unexported methods
}
UnsafeClusterServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to ClusterServer will result in compilation errors.
type Unsubscribe ¶
type Unsubscribe struct { Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"` // contains filtered or unexported fields }
func (*Unsubscribe) Descriptor
deprecated
func (*Unsubscribe) Descriptor() ([]byte, []int)
Deprecated: Use Unsubscribe.ProtoReflect.Descriptor instead.
func (*Unsubscribe) GetTopic ¶
func (x *Unsubscribe) GetTopic() string
func (*Unsubscribe) ProtoMessage ¶
func (*Unsubscribe) ProtoMessage()
func (*Unsubscribe) ProtoReflect ¶
func (x *Unsubscribe) ProtoReflect() protoreflect.Message
func (*Unsubscribe) Reset ¶
func (x *Unsubscribe) Reset()
func (*Unsubscribe) String ¶
func (x *Unsubscribe) String() string