proto

package
v0.0.0-...-288f2f5 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2021 License: GPL-3.0 Imports: 11 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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.

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

Deprecated: Use Tag.ProtoReflect.Descriptor instead.

func (*Tag) GetKey

func (x *Tag) GetKey() string

func (*Tag) GetValue

func (x *Tag) GetValue() string

func (*Tag) ProtoMessage

func (*Tag) ProtoMessage()

func (*Tag) ProtoReflect

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

func (*Tag) Reset

func (x *Tag) Reset()

func (*Tag) String

func (x *Tag) String() string

type UnimplementedLoadBalancerServer

type UnimplementedLoadBalancerServer struct {
}

UnimplementedLoadBalancerServer must be embedded to have forward compatible implementations.

func (UnimplementedLoadBalancerServer) Select

func (UnimplementedLoadBalancerServer) SelectMany

func (UnimplementedLoadBalancerServer) Update

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

func (Utilization_Kind) EnumDescriptor deprecated

func (Utilization_Kind) EnumDescriptor() ([]byte, []int)

Deprecated: Use Utilization_Kind.Descriptor instead.

func (Utilization_Kind) Number

func (Utilization_Kind) String

func (x Utilization_Kind) String() string

func (Utilization_Kind) Type

Jump to

Keyboard shortcuts

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