Documentation ¶
Index ¶
- Constants
- Variables
- func AddNacosConfig(config NacosConfig)
- func DelNacosConfig(label string)
- func RegisterInstance(ip string, port uint64, serviceName string, weight float64, enable bool, ...) (bool, error)
- type Chooser
- type NacosClient
- type NacosConfig
- type NacosInstance
- type NacosResolver
- type NacosService
- type WeightAddrInfo
- type WeightAttributeKey
Constants ¶
View Source
const Name = "nacos_weight_balancer"
Variables ¶
View Source
var NacosConfigs = make(map[string]*NacosConfig)
Functions ¶
Types ¶
type Chooser ¶
type Chooser struct {
// contains filtered or unexported fields
}
Chooser from naming_client package in nacos-sdk-go
type NacosClient ¶
type NacosClient = naming_client.INamingClient
type NacosConfig ¶
type NacosConfig struct { Label string //用做寻找配置的标签 ServiceName string //标记服务名称 Clusters []string GroupName string NacosClient NacosClient }
type NacosInstance ¶
func GetHealthyInstances ¶
func GetHealthyInstances(serviceName string, clusters []string, groupName string, nacosClient NacosClient) ([]NacosInstance, error)
func GetOneHealthyInstance ¶
func GetOneHealthyInstance(serviceName string, clusters []string, groupName string, nacosClient NacosClient) (*NacosInstance, error)
type NacosResolver ¶
type NacosResolver struct {
// contains filtered or unexported fields
}
func (*NacosResolver) Build ¶
func (r *NacosResolver) Build(url resolver.Target, cc resolver.ClientConn, opts resolver.BuildOptions) (resolver.Resolver, error)
func (*NacosResolver) Close ¶
func (r *NacosResolver) Close()
func (*NacosResolver) ResolveNow ¶
func (r *NacosResolver) ResolveNow(resolver.ResolveNowOptions)
func (*NacosResolver) Scheme ¶
func (r *NacosResolver) Scheme() string
type NacosService ¶
func GetService ¶
func GetService(serviceName string, clusters []string, groupName string, nacosClient NacosClient) (NacosService, error)
type WeightAddrInfo ¶
type WeightAddrInfo struct {
Weight int
}
type WeightAttributeKey ¶
type WeightAttributeKey struct{}
Click to show internal directories.
Click to hide internal directories.