Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientOptions ¶
type ClientOptions struct {
TimeoutMs uint64 //timeout for requesting Nacos server, default value is 10000ms
BeatInterval int64 //the time interval for sending beat to server,default value is 5000ms
NamespaceId string //the namespaceId of Nacos
AppName string //the appName
Endpoint string //the endpoint for get Nacos server addresses
RegionId string //the regionId for kms
AccessKey string //the AccessKey for kms
SecretKey string //the SecretKey for kms
OpenKMS bool //it's to open kms,default is false. https://help.aliyun.com/product/28933.html
CacheDir string //the directory for persist nacos service info,default value is current path
UpdateThreadNum int //the number of gorutine for update nacos service info,default value is 20
NotLoadCacheAtStart bool //not to load persistent nacos service info in CacheDir at start time
UpdateCacheWhenEmpty bool //update cache when get empty service instance from server
Username string //the username for nacos auth
Password string //the password for nacos auth
LogDir string //the directory for log, default is current path
RotateTime string //the rotate time for log, eg: 30m, 1h, 24h, default is 24h
MaxAge int64 //the max age of a log file, default value is 3
LogLevel string //the level of log, it's must be debug,info,warn,error, default value is info
ContextPath string //the nacos server contextpath
}
type ConfigOptions ¶
type IConfig ¶
type IConfig interface {
Get(key string) interface{}
GetString(key string) string
GetStringWithDefault(key string, defaultString string) string
GetStringSlice(key string) []string
GetInt64(key string) int64
GetInt64WithDefault(key string, defaultInt64 int64) int64
GetInt(key string) int
GetIntWithDefault(key string, defaultInt int) int
GetUint(key string) uint
GetUintWithDefault(key string, defaultUint uint) uint
GetUint64(key string) uint64
GetUint64WithDefault(key string, defaultUint64 uint64) uint64
GetBool(key string) bool
Set(key string, value interface{})
GetFloat64(key string) float64
Shutdown()
Read() error
Watch()
MergeConfig(eventType server.EventName, eventInfo interface{}) error
SetBaseConfig(reader io.Reader, configType string)
GetStringMapString(key string) map[string]string
}
type Options ¶
type Options struct {
ServerAddrs []string
ClientOptions ClientOptions
ConfigOptions ConfigOptions
}
Click to show internal directories.
Click to hide internal directories.