增加第一个简版的轮询负载均衡

This commit is contained in:
2021-10-19 14:48:46 +08:00
parent 3aaffbeab2
commit 75b557b07f
6 changed files with 178 additions and 2 deletions

20
balance/define/node.go Normal file
View File

@ -0,0 +1,20 @@
// Package define...
//
// Description : define...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 2021-10-19 12:36 下午
package define
// ServerNode 服务器节点的定义
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 12:36 下午 2021/10/19
type ServerNode struct {
HostIP string `json:"host_ip"` // 机器IP
Port int `json:"port"` // 机器端口
Status int `json:"status"` // 机器状态
Weight int `json:"weight"` // 机器权重
}