Documentation ¶
Index ¶
- Variables
- func RegisterLoadBalancerServer(s grpc.ServiceRegistrar, srv LoadBalancerServer)
- type LoadBalancerClient
- type LoadBalancerServer
- type NodeStatus
- func (*NodeStatus) Descriptor() ([]byte, []int)deprecated
- func (x *NodeStatus) GetNodeName() string
- func (x *NodeStatus) GetNumRequests() uint64
- func (x *NodeStatus) GetReady() bool
- func (x *NodeStatus) GetTags() []*Tag
- func (x *NodeStatus) GetTimestamp() *timestamp.Timestamp
- func (x *NodeStatus) GetUtilization() []*Utilization
- func (ns *NodeStatus) GetUtilizationByDimension(dim string) float64
- func (*NodeStatus) ProtoMessage()
- func (x *NodeStatus) ProtoReflect() protoreflect.Message
- func (x *NodeStatus) Reset()
- func (x *NodeStatus) String() string
- type SelectManyRequest
- func (*SelectManyRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SelectManyRequest) GetNumNodes() uint32
- func (x *SelectManyRequest) GetSelect() *SelectRequest
- func (*SelectManyRequest) ProtoMessage()
- func (x *SelectManyRequest) ProtoReflect() protoreflect.Message
- func (x *SelectManyRequest) Reset()
- func (x *SelectManyRequest) String() string
- type SelectManyResponse
- func (*SelectManyResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SelectManyResponse) GetNodes() []*SelectResponse
- func (*SelectManyResponse) ProtoMessage()
- func (x *SelectManyResponse) ProtoReflect() protoreflect.Message
- func (x *SelectManyResponse) Reset()
- func (x *SelectManyResponse) String() string
- type SelectRequest
- func (*SelectRequest) Descriptor() ([]byte, []int)deprecated
- func (x *SelectRequest) GetMandatoryTags() []*Tag
- func (x *SelectRequest) GetTags() []*Tag
- func (*SelectRequest) ProtoMessage()
- func (x *SelectRequest) ProtoReflect() protoreflect.Message
- func (x *SelectRequest) Reset()
- func (x *SelectRequest) String() string
- type SelectResponse
- func (*SelectResponse) Descriptor() ([]byte, []int)deprecated
- func (x *SelectResponse) GetFullness() float64
- func (x *SelectResponse) GetNodeName() string
- func (x *SelectResponse) GetOverflow() bool
- func (x *SelectResponse) GetOverload() bool
- func (*SelectResponse) ProtoMessage()
- func (x *SelectResponse) ProtoReflect() protoreflect.Message
- func (x *SelectResponse) Reset()
- func (x *SelectResponse) String() string
- type Tag
- type UnimplementedLoadBalancerServer
- func (UnimplementedLoadBalancerServer) Select(context.Context, *SelectRequest) (*SelectResponse, error)
- func (UnimplementedLoadBalancerServer) SelectMany(context.Context, *SelectManyRequest) (*SelectManyResponse, error)
- func (UnimplementedLoadBalancerServer) Update(context.Context, *NodeStatus) (*empty.Empty, error)
- type UnsafeLoadBalancerServer
- type Utilization
- func (*Utilization) Descriptor() ([]byte, []int)deprecated
- func (x *Utilization) GetDimension() string
- func (x *Utilization) GetKind() Utilization_Kind
- func (x *Utilization) GetValue() float64
- func (*Utilization) ProtoMessage()
- func (x *Utilization) ProtoReflect() protoreflect.Message
- func (x *Utilization) Reset()
- func (x *Utilization) String() string
- type Utilization_Kind
- func (Utilization_Kind) Descriptor() protoreflect.EnumDescriptor
- func (x Utilization_Kind) Enum() *Utilization_Kind
- func (Utilization_Kind) EnumDescriptor() ([]byte, []int)deprecated
- func (x Utilization_Kind) Number() protoreflect.EnumNumber
- func (x Utilization_Kind) String() string
- func (Utilization_Kind) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( Utilization_Kind_name = map[int32]string{ 0: "GAUGE", 1: "COUNTER", } Utilization_Kind_value = map[string]int32{ "GAUGE": 0, "COUNTER": 1, } )
Enum value maps for Utilization_Kind.
var File_lb_proto protoreflect.FileDescriptor
var LoadBalancer_ServiceDesc = grpc.ServiceDesc{ ServiceName: "lbpb.LoadBalancer", HandlerType: (*LoadBalancerServer)(nil), Methods: []grpc.MethodDesc{ { MethodName: "Update", Handler: _LoadBalancer_Update_Handler, }, { MethodName: "Select", Handler: _LoadBalancer_Select_Handler, }, { MethodName: "SelectMany", Handler: _LoadBalancer_SelectMany_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 LoadBalancerClient ¶
type LoadBalancerClient interface { Update(ctx context.Context, in *NodeStatus, opts ...grpc.CallOption) (*empty.Empty, error) Select(ctx context.Context, in *SelectRequest, opts ...grpc.CallOption) (*SelectResponse, error) SelectMany(ctx context.Context, in *SelectManyRequest, opts ...grpc.CallOption) (*SelectManyResponse, error) }
LoadBalancerClient is the client API for LoadBalancer 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 NewLoadBalancerClient ¶
func NewLoadBalancerClient(cc grpc.ClientConnInterface) LoadBalancerClient
type LoadBalancerServer ¶
type LoadBalancerServer interface { Update(context.Context, *NodeStatus) (*empty.Empty, error) Select(context.Context, *SelectRequest) (*SelectResponse, error) SelectMany(context.Context, *SelectManyRequest) (*SelectManyResponse, error) // contains filtered or unexported methods }
LoadBalancerServer is the server API for LoadBalancer service. All implementations must embed UnimplementedLoadBalancerServer for forward compatibility
type NodeStatus ¶
type NodeStatus struct { NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` Ready bool `protobuf:"varint,2,opt,name=ready,proto3" json:"ready,omitempty"` NumRequests uint64 `protobuf:"varint,3,opt,name=num_requests,json=numRequests,proto3" json:"num_requests,omitempty"` Utilization []*Utilization `protobuf:"bytes,4,rep,name=utilization,proto3" json:"utilization,omitempty"` Tags []*Tag `protobuf:"bytes,5,rep,name=tags,proto3" json:"tags,omitempty"` Timestamp *timestamp.Timestamp `protobuf:"bytes,6,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // contains filtered or unexported fields }
NodeStatus reports the current status of a node, including a mix of static (name, tags) and dynamic (readiness, utilization) information.
func (*NodeStatus) Descriptor
deprecated
func (*NodeStatus) Descriptor() ([]byte, []int)
Deprecated: Use NodeStatus.ProtoReflect.Descriptor instead.
func (*NodeStatus) GetNodeName ¶
func (x *NodeStatus) GetNodeName() string
func (*NodeStatus) GetNumRequests ¶
func (x *NodeStatus) GetNumRequests() uint64
func (*NodeStatus) GetReady ¶
func (x *NodeStatus) GetReady() bool
func (*NodeStatus) GetTags ¶
func (x *NodeStatus) GetTags() []*Tag
func (*NodeStatus) GetTimestamp ¶
func (x *NodeStatus) GetTimestamp() *timestamp.Timestamp
func (*NodeStatus) GetUtilization ¶
func (x *NodeStatus) GetUtilization() []*Utilization
func (*NodeStatus) GetUtilizationByDimension ¶
func (ns *NodeStatus) GetUtilizationByDimension(dim string) float64
func (*NodeStatus) ProtoMessage ¶
func (*NodeStatus) ProtoMessage()
func (*NodeStatus) ProtoReflect ¶
func (x *NodeStatus) ProtoReflect() protoreflect.Message
func (*NodeStatus) Reset ¶
func (x *NodeStatus) Reset()
func (*NodeStatus) String ¶
func (x *NodeStatus) String() string
type SelectManyRequest ¶
type SelectManyRequest struct { Select *SelectRequest `protobuf:"bytes,1,opt,name=select,proto3" json:"select,omitempty"` NumNodes uint32 `protobuf:"varint,2,opt,name=num_nodes,json=numNodes,proto3" json:"num_nodes,omitempty"` // contains filtered or unexported fields }
func (*SelectManyRequest) Descriptor
deprecated
func (*SelectManyRequest) Descriptor() ([]byte, []int)
Deprecated: Use SelectManyRequest.ProtoReflect.Descriptor instead.
func (*SelectManyRequest) GetNumNodes ¶
func (x *SelectManyRequest) GetNumNodes() uint32
func (*SelectManyRequest) GetSelect ¶
func (x *SelectManyRequest) GetSelect() *SelectRequest
func (*SelectManyRequest) ProtoMessage ¶
func (*SelectManyRequest) ProtoMessage()
func (*SelectManyRequest) ProtoReflect ¶
func (x *SelectManyRequest) ProtoReflect() protoreflect.Message
func (*SelectManyRequest) Reset ¶
func (x *SelectManyRequest) Reset()
func (*SelectManyRequest) String ¶
func (x *SelectManyRequest) String() string
type SelectManyResponse ¶
type SelectManyResponse struct { Nodes []*SelectResponse `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"` // contains filtered or unexported fields }
func (*SelectManyResponse) Descriptor
deprecated
func (*SelectManyResponse) Descriptor() ([]byte, []int)
Deprecated: Use SelectManyResponse.ProtoReflect.Descriptor instead.
func (*SelectManyResponse) GetNodes ¶
func (x *SelectManyResponse) GetNodes() []*SelectResponse
func (*SelectManyResponse) ProtoMessage ¶
func (*SelectManyResponse) ProtoMessage()
func (*SelectManyResponse) ProtoReflect ¶
func (x *SelectManyResponse) ProtoReflect() protoreflect.Message
func (*SelectManyResponse) Reset ¶
func (x *SelectManyResponse) Reset()
func (*SelectManyResponse) String ¶
func (x *SelectManyResponse) String() string
type SelectRequest ¶
type SelectRequest struct { Tags []*Tag `protobuf:"bytes,1,rep,name=tags,proto3" json:"tags,omitempty"` MandatoryTags []*Tag `protobuf:"bytes,2,rep,name=mandatory_tags,json=mandatoryTags,proto3" json:"mandatory_tags,omitempty"` // contains filtered or unexported fields }
RPC messages.
func (*SelectRequest) Descriptor
deprecated
func (*SelectRequest) Descriptor() ([]byte, []int)
Deprecated: Use SelectRequest.ProtoReflect.Descriptor instead.
func (*SelectRequest) GetMandatoryTags ¶
func (x *SelectRequest) GetMandatoryTags() []*Tag
func (*SelectRequest) GetTags ¶
func (x *SelectRequest) GetTags() []*Tag
func (*SelectRequest) ProtoMessage ¶
func (*SelectRequest) ProtoMessage()
func (*SelectRequest) ProtoReflect ¶
func (x *SelectRequest) ProtoReflect() protoreflect.Message
func (*SelectRequest) Reset ¶
func (x *SelectRequest) Reset()
func (*SelectRequest) String ¶
func (x *SelectRequest) String() string
type SelectResponse ¶
type SelectResponse struct { NodeName string `protobuf:"bytes,1,opt,name=node_name,json=nodeName,proto3" json:"node_name,omitempty"` Overflow bool `protobuf:"varint,2,opt,name=overflow,proto3" json:"overflow,omitempty"` Overload bool `protobuf:"varint,3,opt,name=overload,proto3" json:"overload,omitempty"` Fullness float64 `protobuf:"fixed64,4,opt,name=fullness,proto3" json:"fullness,omitempty"` // contains filtered or unexported fields }
func (*SelectResponse) Descriptor
deprecated
func (*SelectResponse) Descriptor() ([]byte, []int)
Deprecated: Use SelectResponse.ProtoReflect.Descriptor instead.
func (*SelectResponse) GetFullness ¶
func (x *SelectResponse) GetFullness() float64
func (*SelectResponse) GetNodeName ¶
func (x *SelectResponse) GetNodeName() string
func (*SelectResponse) GetOverflow ¶
func (x *SelectResponse) GetOverflow() bool
func (*SelectResponse) GetOverload ¶
func (x *SelectResponse) GetOverload() bool
func (*SelectResponse) ProtoMessage ¶
func (*SelectResponse) ProtoMessage()
func (*SelectResponse) ProtoReflect ¶
func (x *SelectResponse) ProtoReflect() protoreflect.Message
func (*SelectResponse) Reset ¶
func (x *SelectResponse) Reset()
func (*SelectResponse) String ¶
func (x *SelectResponse) String() string
type Tag ¶
type Tag 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 }
A Tag is just a key/value pair.
func (*Tag) Descriptor
deprecated
func (*Tag) ProtoMessage ¶
func (*Tag) ProtoMessage()
func (*Tag) ProtoReflect ¶
func (x *Tag) ProtoReflect() protoreflect.Message
type UnimplementedLoadBalancerServer ¶
type UnimplementedLoadBalancerServer struct { }
UnimplementedLoadBalancerServer must be embedded to have forward compatible implementations.
func (UnimplementedLoadBalancerServer) Select ¶
func (UnimplementedLoadBalancerServer) Select(context.Context, *SelectRequest) (*SelectResponse, error)
func (UnimplementedLoadBalancerServer) SelectMany ¶
func (UnimplementedLoadBalancerServer) SelectMany(context.Context, *SelectManyRequest) (*SelectManyResponse, error)
func (UnimplementedLoadBalancerServer) Update ¶
func (UnimplementedLoadBalancerServer) Update(context.Context, *NodeStatus) (*empty.Empty, 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.
type Utilization ¶
type Utilization struct { Kind Utilization_Kind `protobuf:"varint,1,opt,name=kind,proto3,enum=lbpb.Utilization_Kind" json:"kind,omitempty"` Dimension string `protobuf:"bytes,2,opt,name=dimension,proto3" json:"dimension,omitempty"` Value float64 `protobuf:"fixed64,3,opt,name=value,proto3" json:"value,omitempty"` // contains filtered or unexported fields }
Utilization along a specific dimension.
func (*Utilization) Descriptor
deprecated
func (*Utilization) Descriptor() ([]byte, []int)
Deprecated: Use Utilization.ProtoReflect.Descriptor instead.
func (*Utilization) GetDimension ¶
func (x *Utilization) GetDimension() string
func (*Utilization) GetKind ¶
func (x *Utilization) GetKind() Utilization_Kind
func (*Utilization) GetValue ¶
func (x *Utilization) GetValue() float64
func (*Utilization) ProtoMessage ¶
func (*Utilization) ProtoMessage()
func (*Utilization) ProtoReflect ¶
func (x *Utilization) ProtoReflect() protoreflect.Message
func (*Utilization) Reset ¶
func (x *Utilization) Reset()
func (*Utilization) String ¶
func (x *Utilization) String() string
type Utilization_Kind ¶
type Utilization_Kind int32
const ( Utilization_GAUGE Utilization_Kind = 0 Utilization_COUNTER Utilization_Kind = 1 )
func (Utilization_Kind) Descriptor ¶
func (Utilization_Kind) Descriptor() protoreflect.EnumDescriptor
func (Utilization_Kind) Enum ¶
func (x Utilization_Kind) Enum() *Utilization_Kind
func (Utilization_Kind) EnumDescriptor
deprecated
func (Utilization_Kind) EnumDescriptor() ([]byte, []int)
Deprecated: Use Utilization_Kind.Descriptor instead.
func (Utilization_Kind) Number ¶
func (x Utilization_Kind) Number() protoreflect.EnumNumber
func (Utilization_Kind) String ¶
func (x Utilization_Kind) String() string
func (Utilization_Kind) Type ¶
func (Utilization_Kind) Type() protoreflect.EnumType