nodev1

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Deprecated: Use Node.ProtoReflect.Descriptor instead.

func (*Node) GetConnCapacity

func (x *Node) GetConnCapacity() int64

func (*Node) GetId

func (x *Node) GetId() string

func (*Node) GetIp

func (x *Node) GetIp() string

func (*Node) GetLabels

func (x *Node) GetLabels() []string

func (*Node) GetLoad

func (x *Node) GetLoad() int64

func (*Node) GetLocation

func (x *Node) GetLocation() string

func (*Node) GetPort

func (x *Node) GetPort() int32

func (*Node) GetWeight

func (x *Node) GetWeight() int32

func (*Node) ProtoMessage

func (*Node) ProtoMessage()

func (*Node) ProtoReflect

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

func (*Node) Reset

func (x *Node) Reset()

func (*Node) String

func (x *Node) String() string

func (*Node) Validate

func (m *Node) Validate() error

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

func (m *Node) ValidateAll() error

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

Deprecated: Use NodeList.ProtoReflect.Descriptor instead.

func (*NodeList) GetNodes

func (x *NodeList) GetNodes() []*Node

func (*NodeList) ProtoMessage

func (*NodeList) ProtoMessage()

func (*NodeList) ProtoReflect

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

func (*NodeList) Reset

func (x *NodeList) Reset()

func (*NodeList) String

func (x *NodeList) String() string

func (*NodeList) Validate

func (m *NodeList) Validate() error

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

func (m *NodeList) ValidateAll() error

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.

Jump to

Keyboard shortcuts

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