proto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DChanService_Receive_FullMethodName            = "/dchan.DChanService/Receive"
	DChanService_RegisterReceiver_FullMethodName   = "/dchan.DChanService/RegisterReceiver"
	DChanService_UnregisterReceiver_FullMethodName = "/dchan.DChanService/UnregisterReceiver"
	DChanService_AddVoter_FullMethodName           = "/dchan.DChanService/AddVoter"
	DChanService_RemoveVoter_FullMethodName        = "/dchan.DChanService/RemoveVoter"
)

Variables

View Source
var DChanService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "dchan.DChanService",
	HandlerType: (*DChanServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Receive",
			Handler:    _DChanService_Receive_Handler,
		},
		{
			MethodName: "RegisterReceiver",
			Handler:    _DChanService_RegisterReceiver_Handler,
		},
		{
			MethodName: "UnregisterReceiver",
			Handler:    _DChanService_UnregisterReceiver_Handler,
		},
		{
			MethodName: "AddVoter",
			Handler:    _DChanService_AddVoter_Handler,
		},
		{
			MethodName: "RemoveVoter",
			Handler:    _DChanService_RemoveVoter_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "dchan.proto",
}

DChanService_ServiceDesc is the grpc.ServiceDesc for DChanService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_dchan_proto protoreflect.FileDescriptor

Functions

func RegisterDChanServiceServer

func RegisterDChanServiceServer(s grpc.ServiceRegistrar, srv DChanServiceServer)

Types

type DChanServiceClient

type DChanServiceClient interface {
	// Receive accepts Gob-encoded data for the server to decode
	Receive(ctx context.Context, in *ReceiveRequest, opts ...grpc.CallOption) (*ReceiveResponse, error)
	RegisterReceiver(ctx context.Context, in *ReceiverRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	UnregisterReceiver(ctx context.Context, in *ReceiverRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
	AddVoter(ctx context.Context, in *ServerInfo, opts ...grpc.CallOption) (*emptypb.Empty, error)
	RemoveVoter(ctx context.Context, in *ServerInfo, opts ...grpc.CallOption) (*emptypb.Empty, error)
}

DChanServiceClient is the client API for DChanService 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.

DChanService provides RPC methods for distributed channel operations

type DChanServiceServer

type DChanServiceServer interface {
	// Receive accepts Gob-encoded data for the server to decode
	Receive(context.Context, *ReceiveRequest) (*ReceiveResponse, error)
	RegisterReceiver(context.Context, *ReceiverRequest) (*emptypb.Empty, error)
	UnregisterReceiver(context.Context, *ReceiverRequest) (*emptypb.Empty, error)
	AddVoter(context.Context, *ServerInfo) (*emptypb.Empty, error)
	RemoveVoter(context.Context, *ServerInfo) (*emptypb.Empty, error)
	// contains filtered or unexported methods
}

DChanServiceServer is the server API for DChanService service. All implementations must embed UnimplementedDChanServiceServer for forward compatibility.

DChanService provides RPC methods for distributed channel operations

type ReceiveRequest

type ReceiveRequest struct {

	// Data contains the Gob-encoded struct
	Data      []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Namespace string `protobuf:"bytes,2,opt,name=namespace,proto3" json:"namespace,omitempty"`
	// contains filtered or unexported fields
}

ReceiveRequest contains Gob-encoded data to be decoded by the server TODO: make it support chunking

func (*ReceiveRequest) Descriptor deprecated

func (*ReceiveRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReceiveRequest.ProtoReflect.Descriptor instead.

func (*ReceiveRequest) GetData

func (x *ReceiveRequest) GetData() []byte

func (*ReceiveRequest) GetNamespace

func (x *ReceiveRequest) GetNamespace() string

func (*ReceiveRequest) ProtoMessage

func (*ReceiveRequest) ProtoMessage()

func (*ReceiveRequest) ProtoReflect

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

func (*ReceiveRequest) Reset

func (x *ReceiveRequest) Reset()

func (*ReceiveRequest) String

func (x *ReceiveRequest) String() string

type ReceiveResponse

type ReceiveResponse struct {
	Received bool `protobuf:"varint,1,opt,name=received,proto3" json:"received,omitempty"`
	// contains filtered or unexported fields
}

ReceiveResponse acknowledges receipt of the data If the server is no longer receiving, the received field will be false.

func (*ReceiveResponse) Descriptor deprecated

func (*ReceiveResponse) Descriptor() ([]byte, []int)

Deprecated: Use ReceiveResponse.ProtoReflect.Descriptor instead.

func (*ReceiveResponse) GetReceived

func (x *ReceiveResponse) GetReceived() bool

func (*ReceiveResponse) ProtoMessage

func (*ReceiveResponse) ProtoMessage()

func (*ReceiveResponse) ProtoReflect

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

func (*ReceiveResponse) Reset

func (x *ReceiveResponse) Reset()

func (*ReceiveResponse) String

func (x *ReceiveResponse) String() string

type ReceiverRequest

type ReceiverRequest struct {
	Namespace string `protobuf:"bytes,1,opt,name=namespace,proto3" json:"namespace,omitempty"`
	ServerId  string `protobuf:"bytes,2,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"`
	Requester string `protobuf:"bytes,3,opt,name=requester,proto3" json:"requester,omitempty"`
	// contains filtered or unexported fields
}

ReceiverRequest is used to register or unregister a receiver for a namespace. It contains the namespace, the server ID of the receiver, and the requester.

This is sent to the leader to register or unregister a receiver.

func (*ReceiverRequest) Descriptor deprecated

func (*ReceiverRequest) Descriptor() ([]byte, []int)

Deprecated: Use ReceiverRequest.ProtoReflect.Descriptor instead.

func (*ReceiverRequest) GetNamespace

func (x *ReceiverRequest) GetNamespace() string

func (*ReceiverRequest) GetRequester

func (x *ReceiverRequest) GetRequester() string

func (*ReceiverRequest) GetServerId

func (x *ReceiverRequest) GetServerId() string

func (*ReceiverRequest) ProtoMessage

func (*ReceiverRequest) ProtoMessage()

func (*ReceiverRequest) ProtoReflect

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

func (*ReceiverRequest) Reset

func (x *ReceiverRequest) Reset()

func (*ReceiverRequest) String

func (x *ReceiverRequest) String() string

type ServerInfo

type ServerInfo struct {
	IdAddress string `protobuf:"bytes,1,opt,name=id_address,json=idAddress,proto3" json:"id_address,omitempty"` // The ID and address of the server to add or remove.
	// contains filtered or unexported fields
}

ServerInfo is used to add or remove a voter from the cluster.

We don't need a timeout as we want to block for a reasonable time until the operation is complete.

func (*ServerInfo) Descriptor deprecated

func (*ServerInfo) Descriptor() ([]byte, []int)

Deprecated: Use ServerInfo.ProtoReflect.Descriptor instead.

func (*ServerInfo) GetIdAddress

func (x *ServerInfo) GetIdAddress() string

func (*ServerInfo) ProtoMessage

func (*ServerInfo) ProtoMessage()

func (*ServerInfo) ProtoReflect

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

func (*ServerInfo) Reset

func (x *ServerInfo) Reset()

func (*ServerInfo) String

func (x *ServerInfo) String() string

type UnimplementedDChanServiceServer

type UnimplementedDChanServiceServer struct{}

UnimplementedDChanServiceServer must be embedded to have forward compatible implementations.

NOTE: this should be embedded by value instead of pointer to avoid a nil pointer dereference when methods are called.

func (UnimplementedDChanServiceServer) AddVoter

func (UnimplementedDChanServiceServer) Receive

func (UnimplementedDChanServiceServer) RegisterReceiver

func (UnimplementedDChanServiceServer) RemoveVoter

func (UnimplementedDChanServiceServer) UnregisterReceiver

type UnsafeDChanServiceServer

type UnsafeDChanServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeDChanServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to DChanServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

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