Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterLoadBalancerServer(s grpc.ServiceRegistrar, srv LoadBalancerServer)
- type Heartreq
- type LoadBalancerClient
- type LoadBalancerServer
- type NotifyRequest
- func (*NotifyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *NotifyRequest) GetGameId() string
- func (x *NotifyRequest) GetServerIp() string
- func (*NotifyRequest) ProtoMessage()
- func (x *NotifyRequest) ProtoReflect() protoreflect.Message
- func (x *NotifyRequest) Reset()
- func (x *NotifyRequest) String() string
- type ServerRequest
- func (*ServerRequest) Descriptor() ([]byte, []int)deprecated
- func (x *ServerRequest) GetIp() string
- func (x *ServerRequest) GetPassword() string
- func (*ServerRequest) ProtoMessage()
- func (x *ServerRequest) ProtoReflect() protoreflect.Message
- func (x *ServerRequest) Reset()
- func (x *ServerRequest) String() string
- type ServerResponse
- type UnimplementedLoadBalancerServer
- func (UnimplementedLoadBalancerServer) HeartBeat(context.Context, *Heartreq) (*ServerResponse, error)
- func (UnimplementedLoadBalancerServer) NewServer(context.Context, *ServerRequest) (*ServerResponse, error)
- func (UnimplementedLoadBalancerServer) Notify(context.Context, *NotifyRequest) (*ServerResponse, error)
- type UnsafeLoadBalancerServer
Constants ¶
const ( LoadBalancer_NewServer_FullMethodName = "/LoadBalancer/NewServer" LoadBalancer_HeartBeat_FullMethodName = "/LoadBalancer/HeartBeat" LoadBalancer_Notify_FullMethodName = "/LoadBalancer/Notify" )
Variables ¶
var File_LB_proto protoreflect.FileDescriptor
var LoadBalancer_ServiceDesc = grpc.ServiceDesc{ ServiceName: "LoadBalancer", HandlerType: (*LoadBalancerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "NewServer", Handler: _LoadBalancer_NewServer_Handler, }, { MethodName: "HeartBeat", Handler: _LoadBalancer_HeartBeat_Handler, }, { MethodName: "Notify", Handler: _LoadBalancer_Notify_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "LB.proto", }
LoadBalancer_ServiceDesc is the grpc.ServiceDesc for LoadBalancer service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)
Functions ¶
func RegisterLoadBalancerServer ¶
func RegisterLoadBalancerServer(s grpc.ServiceRegistrar, srv LoadBalancerServer)
Types ¶
type Heartreq ¶
type Heartreq struct { Status string `protobuf:"bytes,1,opt,name=status,proto3" json:"status,omitempty"` // contains filtered or unexported fields }
func (*Heartreq) Descriptor
deprecated
func (*Heartreq) ProtoMessage ¶
func (*Heartreq) ProtoMessage()
func (*Heartreq) ProtoReflect ¶
func (x *Heartreq) ProtoReflect() protoreflect.Message
type LoadBalancerClient ¶
type LoadBalancerClient interface { // Register a new server with its IP NewServer(ctx context.Context, in *ServerRequest, opts ...grpc.CallOption) (*ServerResponse, error) // Send a heartbeat with the server's IP HeartBeat(ctx context.Context, in *Heartreq, opts ...grpc.CallOption) (*ServerResponse, error) // Notify the load balancer with a game ID and server IP Notify(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*ServerResponse, error) }
LoadBalancerClient is the client API for LoadBalancer service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.golang.ir/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewLoadBalancerClient ¶
func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient
type LoadBalancerServer ¶
type LoadBalancerServer interface { // Register a new server with its IP NewServer(context.Context, *ServerRequest) (*ServerResponse, error) // Send a heartbeat with the server's IP HeartBeat(context.Context, *Heartreq) (*ServerResponse, error) // Notify the load balancer with a game ID and server IP Notify(context.Context, *NotifyRequest) (*ServerResponse, error) // contains filtered or unexported methods }
LoadBalancerServer is the server API for LoadBalancer service. All implementations must embed UnimplementedLoadBalancerServer for forward compatibility
type NotifyRequest ¶
type NotifyRequest struct { GameId string `protobuf:"bytes,1,opt,name=gameId,proto3" json:"gameId,omitempty"` ServerIp string `protobuf:"bytes,2,opt,name=serverIp,proto3" json:"serverIp,omitempty"` // contains filtered or unexported fields }
func (*NotifyRequest) Descriptor
deprecated
func (*NotifyRequest) Descriptor() ([]byte, []int)
Deprecated: Use NotifyRequest.ProtoReflect.Descriptor instead.
func (*NotifyRequest) GetGameId ¶
func (x *NotifyRequest) GetGameId() string
func (*NotifyRequest) GetServerIp ¶
func (x *NotifyRequest) GetServerIp() string
func (*NotifyRequest) ProtoMessage ¶
func (*NotifyRequest) ProtoMessage()
func (*NotifyRequest) ProtoReflect ¶
func (x *NotifyRequest) ProtoReflect() protoreflect.Message
func (*NotifyRequest) Reset ¶
func (x *NotifyRequest) Reset()
func (*NotifyRequest) String ¶
func (x *NotifyRequest) String() string
type ServerRequest ¶
type ServerRequest struct { Ip string `protobuf:"bytes,1,opt,name=ip,proto3" json:"ip,omitempty"` Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // contains filtered or unexported fields }
Define message types
func (*ServerRequest) Descriptor
deprecated
func (*ServerRequest) Descriptor() ([]byte, []int)
Deprecated: Use ServerRequest.ProtoReflect.Descriptor instead.
func (*ServerRequest) GetIp ¶
func (x *ServerRequest) GetIp() string
func (*ServerRequest) GetPassword ¶
func (x *ServerRequest) GetPassword() string
func (*ServerRequest) ProtoMessage ¶
func (*ServerRequest) ProtoMessage()
func (*ServerRequest) ProtoReflect ¶
func (x *ServerRequest) ProtoReflect() protoreflect.Message
func (*ServerRequest) Reset ¶
func (x *ServerRequest) Reset()
func (*ServerRequest) String ¶
func (x *ServerRequest) String() string
type ServerResponse ¶
type ServerResponse struct { ServerId string `protobuf:"bytes,1,opt,name=serverId,proto3" json:"serverId,omitempty"` // contains filtered or unexported fields }
func (*ServerResponse) Descriptor
deprecated
func (*ServerResponse) Descriptor() ([]byte, []int)
Deprecated: Use ServerResponse.ProtoReflect.Descriptor instead.
func (*ServerResponse) GetServerId ¶
func (x *ServerResponse) GetServerId() string
func (*ServerResponse) ProtoMessage ¶
func (*ServerResponse) ProtoMessage()
func (*ServerResponse) ProtoReflect ¶
func (x *ServerResponse) ProtoReflect() protoreflect.Message
func (*ServerResponse) Reset ¶
func (x *ServerResponse) Reset()
func (*ServerResponse) String ¶
func (x *ServerResponse) String() string
type UnimplementedLoadBalancerServer ¶
type UnimplementedLoadBalancerServer struct { }
UnimplementedLoadBalancerServer must be embedded to have forward compatible implementations.
func (UnimplementedLoadBalancerServer) HeartBeat ¶
func (UnimplementedLoadBalancerServer) HeartBeat(context.Context, *Heartreq) (*ServerResponse, error)
func (UnimplementedLoadBalancerServer) NewServer ¶
func (UnimplementedLoadBalancerServer) NewServer(context.Context, *ServerRequest) (*ServerResponse, error)
func (UnimplementedLoadBalancerServer) Notify ¶
func (UnimplementedLoadBalancerServer) Notify(context.Context, *NotifyRequest) (*ServerResponse, error)
type UnsafeLoadBalancerServer ¶
type UnsafeLoadBalancerServer interface {
// contains filtered or unexported methods
}
UnsafeLoadBalancerServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to LoadBalancerServer will result in compilation errors.