nacosKit

package
v2.2.53 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultNamespaceId = constant.DEFAULT_NAMESPACE_ID

	DefaultGroup = constant.DEFAULT_GROUP
)

Variables

View Source
var (
	NotSetUpError = errorKit.New("haven’t been set up")
)

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...

func NewNamingClient

func NewNamingClient(options ...constant.ClientOption) (naming_client.INamingClient, error)

NewNamingClient 创建 服务发现(naming) 客户端.

!!!: (1) 需要先set up. (2) naming_client.INamingClient 实例,如果不用了需要"手动关闭".

@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

type Config

type Config struct {
	/* client */
	// NamespaceId 命名空间的id,配置 "" 和 "public" 效果一样(都是使用保留空间public)
	NamespaceId string `json:"namespaceId" yaml:"namespaceId"`

	/* server */
	Addresses []string `json:"addresses" yaml:"addresses" validate:"required"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL