Documentation
¶
Index ¶
- func GetAllServicesInfo(params GetAllServerInfoParams) (model.ServiceList, error)
- func GetConfig(params GetConfigParams, config any) error
- func GetConfigClient(config ConnectConfig) (config_client.IConfigClient, error)
- func GetInstance(params GetInstanceParams) ([]model.Instance, error)
- func GetNamingClient(config ConnectConfig) (naming_client.INamingClient, error)
- func GetService(params GetServerParams) (model.Service, error)
- func ListenConfig(params ListenConfigParams) error
- func RegisterServer(params RegisterServerParams) (bool, error)
- func SubscribeServer(params SubscribeServerParams) error
- type ConnectConfig
- type GetAllServerInfoParams
- type GetConfigParams
- type GetInstanceParams
- type GetServerParams
- type ListenConfigParams
- type OnChange
- type RegisterServerParams
- type SubscribeServerParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllServicesInfo ¶
func GetAllServicesInfo(params GetAllServerInfoParams) (model.ServiceList, error)
GetAllServicesInfo 获取注册中信的服务
func GetConfigClient ¶
func GetConfigClient(config ConnectConfig) (config_client.IConfigClient, error)
GetConfigClient 配置连接配置
func GetInstance ¶
func GetInstance(params GetInstanceParams) ([]model.Instance, error)
GetInstance 获取注册中信的服务实例
func GetNamingClient ¶
func GetNamingClient(config ConnectConfig) (naming_client.INamingClient, error)
GetNamingClient 服务连接配置
func GetService ¶
func GetService(params GetServerParams) (model.Service, error)
GetService 获取注册中信的服务
func RegisterServer ¶
func RegisterServer(params RegisterServerParams) (bool, error)
RegisterServer 注册服务
func SubscribeServer ¶
func SubscribeServer(params SubscribeServerParams) error
SubscribeServer 服务订阅
Types ¶
type ConnectConfig ¶
type ConnectConfig struct { Host string `json:"host,omitempty"` Port uint64 `json:"port,omitempty"` NamespaceId string `json:"namespace_id,omitempty"` LogDir string `json:"log_dir,omitempty"` CacheDir string `json:"cache_dir,omitempty"` LogLevel string `json:"log_level,omitempty"` AppName string `json:"app_name"` }
type GetAllServerInfoParams ¶
type GetAllServerInfoParams struct { Client naming_client.INamingClient `json:"client,omitempty"` NameSpace string `json:"name_space,omitempty"` // required PageNo uint32 `param:"pageNo"` // optional,default:1 PageSize uint32 `param:"pageSize"` // optional,default:10 GroupName string `json:"group_name,omitempty"` // optional,default:DEFAULT_GROUP }
type GetConfigParams ¶
type GetConfigParams struct { Client config_client.IConfigClient `json:"client,omitempty"` DataId string `json:"data_id,omitempty"` Group string `json:"group,omitempty"` }
type GetInstanceParams ¶
type GetInstanceParams struct { Client naming_client.INamingClient `json:"client,omitempty"` ServiceName string `json:"service_name,omitempty"` // required Cluster []string `json:"cluster_name,omitempty"` // optional,default:DEFAULT GroupName string `json:"group_name,omitempty"` // optional,default:DEFAULT_GROUP }
type GetServerParams ¶
type GetServerParams struct { Client naming_client.INamingClient `json:"client,omitempty"` ServiceName string `json:"service_name,omitempty"` // required Cluster []string `json:"cluster_name,omitempty"` // optional,default:DEFAULT GroupName string `json:"group_name,omitempty"` // optional,default:DEFAULT_GROUP }
type ListenConfigParams ¶
type ListenConfigParams struct { Client config_client.IConfigClient `json:"client,omitempty"` DataId string `json:"data_id,omitempty"` Group string `json:"group,omitempty"` // AppName string `json:"app_name,omitempty"` OnChange OnChange `json:"on_change,omitempty"` }
type RegisterServerParams ¶
type RegisterServerParams struct { Client naming_client.INamingClient `json:"client,omitempty"` Port uint64 `json:"port,omitempty"` // required ServiceName string `json:"service_name,omitempty"` // required ClusterName string `json:"cluster_name,omitempty"` // optional,default:DEFAULT GroupName string `json:"group_name,omitempty"` // optional,default:DEFAULT_GROUP Metadata map[string]string `json:"metadata,omitempty"` // optional }
RegisterServerParams 服务注册参数
type SubscribeServerParams ¶
type SubscribeServerParams struct { Client naming_client.INamingClient `json:"client,omitempty"` ServiceName string `param:"serviceName"` // required Clusters []string `param:"clusters"` // optional,default:DEFAULT GroupName string `param:"groupName"` // optional,default:DEFAULT_GROUP SubscribeCallback func(services []model.Instance, err error) // required }
Click to show internal directories.
Click to hide internal directories.