Documentation
¶
Index ¶
- Variables
- type Node
- func (*Node) Descriptor() ([]byte, []int)deprecated
- func (x *Node) GetConnCapacity() int64
- func (x *Node) GetId() string
- func (x *Node) GetIp() string
- func (x *Node) GetLabels() []string
- func (x *Node) GetLoad() int64
- func (x *Node) GetLocation() string
- func (x *Node) GetPort() int32
- func (x *Node) GetWeight() int32
- func (*Node) ProtoMessage()
- func (x *Node) ProtoReflect() protoreflect.Message
- func (x *Node) Reset()
- func (x *Node) String() string
- func (m *Node) Validate() error
- func (m *Node) ValidateAll() error
- type NodeList
- func (*NodeList) Descriptor() ([]byte, []int)deprecated
- func (x *NodeList) GetNodes() []*Node
- func (*NodeList) ProtoMessage()
- func (x *NodeList) ProtoReflect() protoreflect.Message
- func (x *NodeList) Reset()
- func (x *NodeList) String() string
- func (m *NodeList) Validate() error
- func (m *NodeList) ValidateAll() error
- type NodeListMultiError
- type NodeListValidationError
- type NodeMultiError
- type NodeValidationError
Constants ¶
This section is empty.
Variables ¶
var File_node_v1_node_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Ip string `protobuf:"bytes,2,opt,name=ip,proto3" json:"ip,omitempty"`
Port int32 `protobuf:"varint,3,opt,name=port,proto3" json:"port,omitempty"`
// 节点权重,用于负载均衡算法,取值 [0, 100)。
Weight int32 `protobuf:"varint,4,opt,name=weight,proto3" json:"weight,omitempty"`
// 节点位置。
Location string `protobuf:"bytes,5,opt,name=location,proto3" json:"location,omitempty"`
// 节点容量 ( 可支撑连接数的最大值 )。
ConnCapacity int64 `protobuf:"varint,6,opt,name=conn_capacity,json=connCapacity,proto3" json:"conn_capacity,omitempty"`
// 节点当前负载。
Load int64 `protobuf:"varint,7,opt,name=load,proto3" json:"load,omitempty"`
// 节点标签。
Labels []string `protobuf:"bytes,8,rep,name=labels,proto3" json:"labels,omitempty"`
// contains filtered or unexported fields
}
Node 标识一个网关节点信息。 用于负载均衡和连接重定向策略。
func (*Node) Descriptor
deprecated
func (*Node) GetConnCapacity ¶
func (*Node) GetLocation ¶
func (*Node) ProtoMessage ¶
func (*Node) ProtoMessage()
func (*Node) ProtoReflect ¶
func (x *Node) ProtoReflect() protoreflect.Message
func (*Node) Validate ¶
Validate checks the field values on Node with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Node) ValidateAll ¶
ValidateAll checks the field values on Node with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in NodeMultiError, or nil if none found.
type NodeList ¶
type NodeList struct {
Nodes []*Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
// contains filtered or unexported fields
}
func (*NodeList) Descriptor
deprecated
func (*NodeList) ProtoMessage ¶
func (*NodeList) ProtoMessage()
func (*NodeList) ProtoReflect ¶
func (x *NodeList) ProtoReflect() protoreflect.Message
func (*NodeList) Validate ¶
Validate checks the field values on NodeList with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*NodeList) ValidateAll ¶
ValidateAll checks the field values on NodeList with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in NodeListMultiError, or nil if none found.
type NodeListMultiError ¶
type NodeListMultiError []error
NodeListMultiError is an error wrapping multiple validation errors returned by NodeList.ValidateAll() if the designated constraints aren't met.
func (NodeListMultiError) AllErrors ¶
func (m NodeListMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (NodeListMultiError) Error ¶
func (m NodeListMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type NodeListValidationError ¶
type NodeListValidationError struct {
// contains filtered or unexported fields
}
NodeListValidationError is the validation error returned by NodeList.Validate if the designated constraints aren't met.
func (NodeListValidationError) Cause ¶
func (e NodeListValidationError) Cause() error
Cause function returns cause value.
func (NodeListValidationError) Error ¶
func (e NodeListValidationError) Error() string
Error satisfies the builtin error interface
func (NodeListValidationError) ErrorName ¶
func (e NodeListValidationError) ErrorName() string
ErrorName returns error name.
func (NodeListValidationError) Field ¶
func (e NodeListValidationError) Field() string
Field function returns field value.
func (NodeListValidationError) Key ¶
func (e NodeListValidationError) Key() bool
Key function returns key value.
func (NodeListValidationError) Reason ¶
func (e NodeListValidationError) Reason() string
Reason function returns reason value.
type NodeMultiError ¶
type NodeMultiError []error
NodeMultiError is an error wrapping multiple validation errors returned by Node.ValidateAll() if the designated constraints aren't met.
func (NodeMultiError) AllErrors ¶
func (m NodeMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (NodeMultiError) Error ¶
func (m NodeMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type NodeValidationError ¶
type NodeValidationError struct {
// contains filtered or unexported fields
}
NodeValidationError is the validation error returned by Node.Validate if the designated constraints aren't met.
func (NodeValidationError) Cause ¶
func (e NodeValidationError) Cause() error
Cause function returns cause value.
func (NodeValidationError) Error ¶
func (e NodeValidationError) Error() string
Error satisfies the builtin error interface
func (NodeValidationError) ErrorName ¶
func (e NodeValidationError) ErrorName() string
ErrorName returns error name.
func (NodeValidationError) Field ¶
func (e NodeValidationError) Field() string
Field function returns field value.
func (NodeValidationError) Key ¶
func (e NodeValidationError) Key() bool
Key function returns key value.
func (NodeValidationError) Reason ¶
func (e NodeValidationError) Reason() string
Reason function returns reason value.