Documentation ¶
Index ¶
- Constants
- Variables
- func GetClientConfigCopy(options ...constant.ClientOption) (*constant.ClientConfig, error)
- func GetNamespaceId() (string, error)
- func MustSetUp(config *Config, options ...constant.ClientOption)
- func NewConfigClient(options ...constant.ClientOption) (config_client.IConfigClient, error)
- func NewNamingClient(options ...constant.ClientOption) (naming_client.INamingClient, error)
- func SetUp(config *Config, options ...constant.ClientOption) (err error)
- type Config
Constants ¶
View Source
const ( DefaultNamespaceId = constant.DEFAULT_NAMESPACE_ID DefaultGroup = constant.DEFAULT_GROUP )
Variables ¶
View Source
var (
NotSetUpError = errorKit.Newf("haven’t been set up correctly")
)
Functions ¶
func GetClientConfigCopy ¶
func GetClientConfigCopy(options ...constant.ClientOption) (*constant.ClientConfig, error)
func MustSetUp ¶
func MustSetUp(config *Config, options ...constant.ClientOption)
func NewConfigClient ¶
func NewConfigClient(options ...constant.ClientOption) (config_client.IConfigClient, error)
NewConfigClient 创建 动态配置(config) 客户端.
!!!: (1) 需要先set up. (2) config_client.IConfigClient 实例,如果不用了需要"手动关闭".
@param options 可以用于修改: NamespaceId、CacheDir、LogDir、LogLevel...
func NewNamingClient ¶
func NewNamingClient(options ...constant.ClientOption) (naming_client.INamingClient, error)
NewNamingClient 创建 服务发现(naming) 客户端.
!!!: (1) 需要先set up; (2) naming_client.INamingClient 实例,如果不用了需要"手动关闭"; (3) !!!: 不要在 Nacos管理页面 上修改服务实例的信息(weight等),否则可能导致后续 RegisterInstance 、UpdateInstance 会失败(虽然方法返回true, nil).
@param options 可以用于修改: NamespaceId...
func SetUp ¶
func SetUp(config *Config, options ...constant.ClientOption) (err error)
SetUp
@param options !!!:
(1) 建议配置 客户端的缓存目录(default is current path) constant.WithCacheDir (2) 建议配置 客户端的日志目录(default is current path) constant.WithLogDir (3) 建议配置 客户端的日志级别(default value is info) constant.WithLogLevel "debug" || "info"(默认)...
Types ¶
Click to show internal directories.
Click to hide internal directories.