pb

package
v0.0.0-...-e65b650 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CacheService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pb.CacheService",
	HandlerType: (*CacheServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _CacheService_Get_Handler,
		},
		{
			MethodName: "Put",
			Handler:    _CacheService_Put_Handler,
		},
		{
			MethodName: "GetPid",
			Handler:    _CacheService_GetPid_Handler,
		},
		{
			MethodName: "GetLeader",
			Handler:    _CacheService_GetLeader_Handler,
		},
		{
			MethodName: "GetHeartbeat",
			Handler:    _CacheService_GetHeartbeat_Handler,
		},
		{
			MethodName: "UpdateLeader",
			Handler:    _CacheService_UpdateLeader_Handler,
		},
		{
			MethodName: "RequestElection",
			Handler:    _CacheService_RequestElection_Handler,
		},
		{
			MethodName: "GetClusterConfig",
			Handler:    _CacheService_GetClusterConfig_Handler,
		},
		{
			MethodName: "UpdateClusterConfig",
			Handler:    _CacheService_UpdateClusterConfig_Handler,
		},
		{
			MethodName: "RegisterNodeWithCluster",
			Handler:    _CacheService_RegisterNodeWithCluster_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "cache_service.proto",
}

CacheService_ServiceDesc is the grpc.ServiceDesc for CacheService 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_cache_service_proto protoreflect.FileDescriptor

Functions

func RegisterCacheServiceServer

func RegisterCacheServiceServer(s grpc.ServiceRegistrar, srv CacheServiceServer)

Types

type CacheServiceClient

type CacheServiceClient interface {
	// Get/Put operations
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
	Put(ctx context.Context, in *PutRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	// Elections
	GetPid(ctx context.Context, in *PidRequest, opts ...grpc.CallOption) (*PidResponse, error)
	GetLeader(ctx context.Context, in *LeaderRequest, opts ...grpc.CallOption) (*LeaderResponse, error)
	GetHeartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*empty.Empty, error)
	UpdateLeader(ctx context.Context, in *NewLeaderAnnouncement, opts ...grpc.CallOption) (*GenericResponse, error)
	RequestElection(ctx context.Context, in *ElectionRequest, opts ...grpc.CallOption) (*GenericResponse, error)
	// Cluster management
	GetClusterConfig(ctx context.Context, in *ClusterConfigRequest, opts ...grpc.CallOption) (*ClusterConfig, error)
	UpdateClusterConfig(ctx context.Context, in *ClusterConfig, opts ...grpc.CallOption) (*empty.Empty, error)
	RegisterNodeWithCluster(ctx context.Context, in *Node, opts ...grpc.CallOption) (*GenericResponse, error)
}

CacheServiceClient is the client API for CacheService 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 CacheServiceServer

type CacheServiceServer interface {
	// Get/Put operations
	Get(context.Context, *GetRequest) (*GetResponse, error)
	Put(context.Context, *PutRequest) (*empty.Empty, error)
	// Elections
	GetPid(context.Context, *PidRequest) (*PidResponse, error)
	GetLeader(context.Context, *LeaderRequest) (*LeaderResponse, error)
	GetHeartbeat(context.Context, *HeartbeatRequest) (*empty.Empty, error)
	UpdateLeader(context.Context, *NewLeaderAnnouncement) (*GenericResponse, error)
	RequestElection(context.Context, *ElectionRequest) (*GenericResponse, error)
	// Cluster management
	GetClusterConfig(context.Context, *ClusterConfigRequest) (*ClusterConfig, error)
	UpdateClusterConfig(context.Context, *ClusterConfig) (*empty.Empty, error)
	RegisterNodeWithCluster(context.Context, *Node) (*GenericResponse, error)
	// contains filtered or unexported methods
}

CacheServiceServer is the server API for CacheService service. All implementations must embed UnimplementedCacheServiceServer for forward compatibility

type ClusterConfig

type ClusterConfig struct {
	Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
	// contains filtered or unexported fields
}

func (*ClusterConfig) Descriptor deprecated

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

Deprecated: Use ClusterConfig.ProtoReflect.Descriptor instead.

func (*ClusterConfig) GetNodes

func (x *ClusterConfig) GetNodes() []*Node

func (*ClusterConfig) ProtoMessage

func (*ClusterConfig) ProtoMessage()

func (*ClusterConfig) ProtoReflect

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

func (*ClusterConfig) Reset

func (x *ClusterConfig) Reset()

func (*ClusterConfig) String

func (x *ClusterConfig) String() string

type ClusterConfigRequest

type ClusterConfigRequest struct {
	CallerNodeId string `protobuf:"bytes,1,opt,name=caller_node_id,json=callerNodeId,proto3" json:"caller_node_id,omitempty"`
	// contains filtered or unexported fields
}

func (*ClusterConfigRequest) Descriptor deprecated

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

Deprecated: Use ClusterConfigRequest.ProtoReflect.Descriptor instead.

func (*ClusterConfigRequest) GetCallerNodeId

func (x *ClusterConfigRequest) GetCallerNodeId() string

func (*ClusterConfigRequest) ProtoMessage

func (*ClusterConfigRequest) ProtoMessage()

func (*ClusterConfigRequest) ProtoReflect

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

func (*ClusterConfigRequest) Reset

func (x *ClusterConfigRequest) Reset()

func (*ClusterConfigRequest) String

func (x *ClusterConfigRequest) String() string

type ElectionRequest

type ElectionRequest struct {
	CallerPid    int32  `protobuf:"varint,1,opt,name=caller_pid,json=callerPid,proto3" json:"caller_pid,omitempty"`
	CallerNodeId string `protobuf:"bytes,2,opt,name=caller_node_id,json=callerNodeId,proto3" json:"caller_node_id,omitempty"`
	// contains filtered or unexported fields
}

election messages

func (*ElectionRequest) Descriptor deprecated

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

Deprecated: Use ElectionRequest.ProtoReflect.Descriptor instead.

func (*ElectionRequest) GetCallerNodeId

func (x *ElectionRequest) GetCallerNodeId() string

func (*ElectionRequest) GetCallerPid

func (x *ElectionRequest) GetCallerPid() int32

func (*ElectionRequest) ProtoMessage

func (*ElectionRequest) ProtoMessage()

func (*ElectionRequest) ProtoReflect

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

func (*ElectionRequest) Reset

func (x *ElectionRequest) Reset()

func (*ElectionRequest) String

func (x *ElectionRequest) String() string

type GenericResponse

type GenericResponse struct {
	Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GenericResponse) Descriptor deprecated

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

Deprecated: Use GenericResponse.ProtoReflect.Descriptor instead.

func (*GenericResponse) GetData

func (x *GenericResponse) GetData() string

func (*GenericResponse) ProtoMessage

func (*GenericResponse) ProtoMessage()

func (*GenericResponse) ProtoReflect

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

func (*GenericResponse) Reset

func (x *GenericResponse) Reset()

func (*GenericResponse) String

func (x *GenericResponse) String() string

type GetRequest

type GetRequest struct {
	Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	// contains filtered or unexported fields
}

get/put messages

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetKey

func (x *GetRequest) GetKey() string

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Data string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetData

func (x *GetResponse) GetData() string

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type HeartbeatRequest

type HeartbeatRequest struct {
	CallerNodeId string `protobuf:"bytes,1,opt,name=caller_node_id,json=callerNodeId,proto3" json:"caller_node_id,omitempty"`
	// contains filtered or unexported fields
}

func (*HeartbeatRequest) Descriptor deprecated

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

Deprecated: Use HeartbeatRequest.ProtoReflect.Descriptor instead.

func (*HeartbeatRequest) GetCallerNodeId

func (x *HeartbeatRequest) GetCallerNodeId() string

func (*HeartbeatRequest) ProtoMessage

func (*HeartbeatRequest) ProtoMessage()

func (*HeartbeatRequest) ProtoReflect

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

func (*HeartbeatRequest) Reset

func (x *HeartbeatRequest) Reset()

func (*HeartbeatRequest) String

func (x *HeartbeatRequest) String() string

type HeartbeatResponse

type HeartbeatResponse struct {
	NodeId string `protobuf:"bytes,1,opt,name=node_id,json=nodeId,proto3" json:"node_id,omitempty"`
	Status string `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

func (*HeartbeatResponse) Descriptor deprecated

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

Deprecated: Use HeartbeatResponse.ProtoReflect.Descriptor instead.

func (*HeartbeatResponse) GetNodeId

func (x *HeartbeatResponse) GetNodeId() string

func (*HeartbeatResponse) GetStatus

func (x *HeartbeatResponse) GetStatus() string

func (*HeartbeatResponse) ProtoMessage

func (*HeartbeatResponse) ProtoMessage()

func (*HeartbeatResponse) ProtoReflect

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

func (*HeartbeatResponse) Reset

func (x *HeartbeatResponse) Reset()

func (*HeartbeatResponse) String

func (x *HeartbeatResponse) String() string

type LeaderRequest

type LeaderRequest struct {
	Caller string `protobuf:"bytes,1,opt,name=caller,proto3" json:"caller,omitempty"`
	// contains filtered or unexported fields
}

func (*LeaderRequest) Descriptor deprecated

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

Deprecated: Use LeaderRequest.ProtoReflect.Descriptor instead.

func (*LeaderRequest) GetCaller

func (x *LeaderRequest) GetCaller() string

func (*LeaderRequest) ProtoMessage

func (*LeaderRequest) ProtoMessage()

func (*LeaderRequest) ProtoReflect

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

func (*LeaderRequest) Reset

func (x *LeaderRequest) Reset()

func (*LeaderRequest) String

func (x *LeaderRequest) String() string

type LeaderResponse

type LeaderResponse struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*LeaderResponse) Descriptor deprecated

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

Deprecated: Use LeaderResponse.ProtoReflect.Descriptor instead.

func (*LeaderResponse) GetId

func (x *LeaderResponse) GetId() string

func (*LeaderResponse) ProtoMessage

func (*LeaderResponse) ProtoMessage()

func (*LeaderResponse) ProtoReflect

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

func (*LeaderResponse) Reset

func (x *LeaderResponse) Reset()

func (*LeaderResponse) String

func (x *LeaderResponse) String() string

type NewLeaderAnnouncement

type NewLeaderAnnouncement struct {
	LeaderId string `protobuf:"bytes,1,opt,name=leader_id,json=leaderId,proto3" json:"leader_id,omitempty"`
	// contains filtered or unexported fields
}

func (*NewLeaderAnnouncement) Descriptor deprecated

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

Deprecated: Use NewLeaderAnnouncement.ProtoReflect.Descriptor instead.

func (*NewLeaderAnnouncement) GetLeaderId

func (x *NewLeaderAnnouncement) GetLeaderId() string

func (*NewLeaderAnnouncement) ProtoMessage

func (*NewLeaderAnnouncement) ProtoMessage()

func (*NewLeaderAnnouncement) ProtoReflect

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

func (*NewLeaderAnnouncement) Reset

func (x *NewLeaderAnnouncement) Reset()

func (*NewLeaderAnnouncement) String

func (x *NewLeaderAnnouncement) String() string

type Node

type Node struct {
	Id       string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Host     string `protobuf:"bytes,2,opt,name=host,proto3" json:"host,omitempty"`
	RestPort int32  `protobuf:"varint,3,opt,name=rest_port,json=restPort,proto3" json:"rest_port,omitempty"`
	GrpcPort int32  `protobuf:"varint,4,opt,name=grpc_port,json=grpcPort,proto3" json:"grpc_port,omitempty"`
	// contains filtered or unexported fields
}

cluster config messages

func (*Node) Descriptor deprecated

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

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetGrpcPort

func (x *Node) GetGrpcPort() int32

func (*Node) GetHost

func (x *Node) GetHost() string

func (*Node) GetId

func (x *Node) GetId() string

func (*Node) GetRestPort

func (x *Node) GetRestPort() int32

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

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

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

type PidRequest

type PidRequest struct {
	CallerPid int32 `protobuf:"varint,1,opt,name=caller_pid,json=callerPid,proto3" json:"caller_pid,omitempty"`
	// contains filtered or unexported fields
}

func (*PidRequest) Descriptor deprecated

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

Deprecated: Use PidRequest.ProtoReflect.Descriptor instead.

func (*PidRequest) GetCallerPid

func (x *PidRequest) GetCallerPid() int32

func (*PidRequest) ProtoMessage

func (*PidRequest) ProtoMessage()

func (*PidRequest) ProtoReflect

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

func (*PidRequest) Reset

func (x *PidRequest) Reset()

func (*PidRequest) String

func (x *PidRequest) String() string

type PidResponse

type PidResponse struct {
	Pid int32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"`
	// contains filtered or unexported fields
}

func (*PidResponse) Descriptor deprecated

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

Deprecated: Use PidResponse.ProtoReflect.Descriptor instead.

func (*PidResponse) GetPid

func (x *PidResponse) GetPid() int32

func (*PidResponse) ProtoMessage

func (*PidResponse) ProtoMessage()

func (*PidResponse) ProtoReflect

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

func (*PidResponse) Reset

func (x *PidResponse) Reset()

func (*PidResponse) String

func (x *PidResponse) String() string

type PutRequest

type PutRequest struct {
	Key   string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
	// contains filtered or unexported fields
}

func (*PutRequest) Descriptor deprecated

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

Deprecated: Use PutRequest.ProtoReflect.Descriptor instead.

func (*PutRequest) GetKey

func (x *PutRequest) GetKey() string

func (*PutRequest) GetValue

func (x *PutRequest) GetValue() string

func (*PutRequest) ProtoMessage

func (*PutRequest) ProtoMessage()

func (*PutRequest) ProtoReflect

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

func (*PutRequest) Reset

func (x *PutRequest) Reset()

func (*PutRequest) String

func (x *PutRequest) String() string

type UnimplementedCacheServiceServer

type UnimplementedCacheServiceServer struct {
}

UnimplementedCacheServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCacheServiceServer) Get

func (UnimplementedCacheServiceServer) GetClusterConfig

func (UnimplementedCacheServiceServer) GetHeartbeat

func (UnimplementedCacheServiceServer) GetLeader

func (UnimplementedCacheServiceServer) GetPid

func (UnimplementedCacheServiceServer) Put

func (UnimplementedCacheServiceServer) RegisterNodeWithCluster

func (UnimplementedCacheServiceServer) RequestElection

func (UnimplementedCacheServiceServer) UpdateClusterConfig

func (UnimplementedCacheServiceServer) UpdateLeader

type UnsafeCacheServiceServer

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

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

Jump to

Keyboard shortcuts

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