LoadBalancer

package
v0.0.0-...-3b6dc87 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LoadBalancer_NewServer_FullMethodName = "/LoadBalancer/NewServer"
	LoadBalancer_HeartBeat_FullMethodName = "/LoadBalancer/HeartBeat"
	LoadBalancer_Notify_FullMethodName    = "/LoadBalancer/Notify"
)

Variables

View Source
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) Descriptor() ([]byte, []int)

Deprecated: Use Heartreq.ProtoReflect.Descriptor instead.

func (*Heartreq) GetStatus

func (x *Heartreq) GetStatus() string

func (*Heartreq) ProtoMessage

func (*Heartreq) ProtoMessage()

func (*Heartreq) ProtoReflect

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

func (*Heartreq) Reset

func (x *Heartreq) Reset()

func (*Heartreq) String

func (x *Heartreq) String() string

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.

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

func (UnimplementedLoadBalancerServer) Notify

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.

Jump to

Keyboard shortcuts

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