Documentation ¶
Index ¶
- func NewNamingProxyDelegate(clientCfg constant2.ClientConfig, serverCfgs []constant2.ServerConfig, ...) (naming_proxy2.INamingProxy, error)
- type Chooser
- type INamingClient
- type NamingClient
- func (sc *NamingClient) CloseClient()
- func (sc *NamingClient) DeregisterInstance(param vo2.DeregisterInstanceParam) (bool, error)
- func (sc *NamingClient) GetAllServicesInfo(param vo2.GetAllServiceInfoParam) (model2.ServiceList, error)
- func (sc *NamingClient) GetService(param vo2.GetServiceParam) (service model2.Service, err error)
- func (sc *NamingClient) RegisterInstance(param vo2.RegisterInstanceParam) (bool, error)
- func (sc *NamingClient) SelectAllInstances(param vo2.SelectAllInstancesParam) ([]model2.Instance, error)
- func (sc *NamingClient) SelectInstances(param vo2.SelectInstancesParam) ([]model2.Instance, error)
- func (sc *NamingClient) SelectOneHealthyInstance(param vo2.SelectOneHealthInstanceParam) (*model2.Instance, error)
- func (sc *NamingClient) Subscribe(param *vo2.SubscribeParam) error
- func (sc *NamingClient) Unsubscribe(param *vo2.SubscribeParam) (err error)
- func (sc *NamingClient) UpdateInstance(param vo2.UpdateInstanceParam) (bool, error)
- type NamingProxyDelegate
- func (proxy *NamingProxyDelegate) CloseClient()
- func (proxy *NamingProxyDelegate) DeregisterInstance(serviceName string, groupName string, instance model2.Instance) (bool, error)
- func (proxy *NamingProxyDelegate) GetServiceList(pageNo uint32, pageSize uint32, groupName string, ...) (model2.ServiceList, error)
- func (proxy *NamingProxyDelegate) QueryInstancesOfService(serviceName, groupName, clusters string, udpPort int, healthyOnly bool) (*model2.Service, error)
- func (proxy *NamingProxyDelegate) RegisterInstance(serviceName string, groupName string, instance model2.Instance) (bool, error)
- func (proxy *NamingProxyDelegate) ServerHealthy() bool
- func (proxy *NamingProxyDelegate) Subscribe(serviceName, groupName string, clusters string) (model2.Service, error)
- func (proxy *NamingProxyDelegate) Unsubscribe(serviceName, groupName, clusters string) error
- type ServiceInfoUpdater
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewNamingProxyDelegate ¶
func NewNamingProxyDelegate(clientCfg constant2.ClientConfig, serverCfgs []constant2.ServerConfig, httpAgent http_agent2.IHttpAgent, serviceInfoHolder *naming_cache2.ServiceInfoHolder) (naming_proxy2.INamingProxy, error)
Types ¶
type INamingClient ¶
type INamingClient interface { // RegisterInstance use to register instance // Ip require // Port require // Weight require,it must be lager than 0 // Enable require,the instance can be access or not // Healthy require,the instance is health or not // Metadata optional // ClusterName optional,default:DEFAULT // ServiceName require // GroupName optional,default:DEFAULT_GROUP // Ephemeral optional RegisterInstance(param vo2.RegisterInstanceParam) (bool, error) // DeregisterInstance use to deregister instance // Ip required // Port required // Tenant optional // Cluster optional,default:DEFAULT // ServiceName require // GroupName optional,default:DEFAULT_GROUP // Ephemeral optional DeregisterInstance(param vo2.DeregisterInstanceParam) (bool, error) // UpdateInstance use to update instance // Ip require // Port require // Weight require,it must be lager than 0 // Enable require,the instance can be access or not // Healthy require,the instance is health or not // Metadata optional // ClusterName optional,default:DEFAULT // ServiceName require // GroupName optional,default:DEFAULT_GROUP // Ephemeral optional UpdateInstance(param vo2.UpdateInstanceParam) (bool, error) // GetService use to get service // ServiceName require // Clusters optional,default:DEFAULT // GroupName optional,default:DEFAULT_GROUP GetService(param vo2.GetServiceParam) (model2.Service, error) // SelectAllInstances return all instances,include healthy=false,enable=false,weight<=0 // ServiceName require // Clusters optional,default:DEFAULT // GroupName optional,default:DEFAULT_GROUP SelectAllInstances(param vo2.SelectAllInstancesParam) ([]model2.Instance, error) // SelectInstances only return the instances of healthy=${HealthyOnly},enable=true and weight>0 // ServiceName require // Clusters optional,default:DEFAULT // GroupName optional,default:DEFAULT_GROUP // HealthyOnly optional SelectInstances(param vo2.SelectInstancesParam) ([]model2.Instance, error) // SelectOneHealthyInstance return one instance by WRR strategy for load balance // And the instance should be health=true,enable=true and weight>0 // ServiceName require // Clusters optional,default:DEFAULT // GroupName optional,default:DEFAULT_GROUP SelectOneHealthyInstance(param vo2.SelectOneHealthInstanceParam) (*model2.Instance, error) // Subscribe use to subscribe service change event // ServiceName require // Clusters optional,default:DEFAULT // GroupName optional,default:DEFAULT_GROUP // SubscribeCallback require Subscribe(param *vo2.SubscribeParam) error // Unsubscribe use to unsubscribe service change event // ServiceName require // Clusters optional,default:DEFAULT // GroupName optional,default:DEFAULT_GROUP // SubscribeCallback require Unsubscribe(param *vo2.SubscribeParam) error // GetAllServicesInfo use to get all service info by page GetAllServicesInfo(param vo2.GetAllServiceInfoParam) (model2.ServiceList, error) //CloseClient close the GRPC client CloseClient() }
INamingClient interface for naming client
type NamingClient ¶
type NamingClient struct { nacos_client2.INacosClient // contains filtered or unexported fields }
NamingClient ...
func NewNamingClient ¶
func NewNamingClient(nc nacos_client2.INacosClient) (*NamingClient, error)
NewNamingClient ...
func (*NamingClient) DeregisterInstance ¶
func (sc *NamingClient) DeregisterInstance(param vo2.DeregisterInstanceParam) (bool, error)
DeregisterInstance ...
func (*NamingClient) GetAllServicesInfo ¶
func (sc *NamingClient) GetAllServicesInfo(param vo2.GetAllServiceInfoParam) (model2.ServiceList, error)
GetAllServicesInfo Get all instance by Namespace and Group with page
func (*NamingClient) GetService ¶
func (sc *NamingClient) GetService(param vo2.GetServiceParam) (service model2.Service, err error)
GetService Get service info by Group and DataId, clusters was optional
func (*NamingClient) RegisterInstance ¶
func (sc *NamingClient) RegisterInstance(param vo2.RegisterInstanceParam) (bool, error)
RegisterInstance ...
func (*NamingClient) SelectAllInstances ¶
func (sc *NamingClient) SelectAllInstances(param vo2.SelectAllInstancesParam) ([]model2.Instance, error)
SelectAllInstances Get all instance by DataId 和 Group
func (*NamingClient) SelectInstances ¶
func (sc *NamingClient) SelectInstances(param vo2.SelectInstancesParam) ([]model2.Instance, error)
SelectInstances Get all instance by DataId, Group and Health
func (*NamingClient) SelectOneHealthyInstance ¶
func (sc *NamingClient) SelectOneHealthyInstance(param vo2.SelectOneHealthInstanceParam) (*model2.Instance, error)
SelectOneHealthyInstance Get one healthy instance by DataId and Group
func (*NamingClient) Subscribe ¶
func (sc *NamingClient) Subscribe(param *vo2.SubscribeParam) error
Subscribe ...
func (*NamingClient) Unsubscribe ¶
func (sc *NamingClient) Unsubscribe(param *vo2.SubscribeParam) (err error)
Unsubscribe ...
func (*NamingClient) UpdateInstance ¶
func (sc *NamingClient) UpdateInstance(param vo2.UpdateInstanceParam) (bool, error)
UpdateInstance ...
type NamingProxyDelegate ¶
type NamingProxyDelegate struct {
// contains filtered or unexported fields
}
NamingProxyDelegate ...
func (*NamingProxyDelegate) CloseClient ¶
func (proxy *NamingProxyDelegate) CloseClient()
func (*NamingProxyDelegate) DeregisterInstance ¶
func (*NamingProxyDelegate) GetServiceList ¶
func (proxy *NamingProxyDelegate) GetServiceList(pageNo uint32, pageSize uint32, groupName string, selector *model2.ExpressionSelector) (model2.ServiceList, error)
func (*NamingProxyDelegate) QueryInstancesOfService ¶
func (*NamingProxyDelegate) RegisterInstance ¶
func (*NamingProxyDelegate) ServerHealthy ¶
func (proxy *NamingProxyDelegate) ServerHealthy() bool
func (*NamingProxyDelegate) Unsubscribe ¶
func (proxy *NamingProxyDelegate) Unsubscribe(serviceName, groupName, clusters string) error
type ServiceInfoUpdater ¶
type ServiceInfoUpdater struct {
// contains filtered or unexported fields
}
func NewServiceInfoUpdater ¶
func NewServiceInfoUpdater(serviceInfoHolder *naming_cache2.ServiceInfoHolder, updateThreadNum int, namingProxy naming_proxy2.INamingProxy) *ServiceInfoUpdater
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package naming_proxy is a generated GoMock package.
|
Package naming_proxy is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.