Documentation
¶
Index ¶
- func CreateOptions(cntCfg ClientConfig, cacheDir, logDir string) (options []constant.ClientOption)
- func FetchConfig(conf *Config) (config.Config, error)
- func NewNaCosClientParam(cfg *Config) vo.NacosClientParam
- func NewNaCosConfigClient(conf *Config) config_client.IConfigClient
- func NewNaCosDiscovery(conf *Config) registry.Discovery
- func NewNaCosDiscoveryWiths(opts ...Option) registry.Discovery
- func NewNaCosNamingClient(conf *Config) naming_client.INamingClient
- func NewNaCosRegistrar(conf *Config) registry.Registrar
- func NewNaCosRegistrarWiths(opts ...Option) registry.Registrar
- func NewSources[T any](sources ...T) []T
- type ClientConfig
- type ClientOption
- func (c *ClientOption) GetCacheDir() string
- func (c *ClientOption) GetLogDir() string
- func (c *ClientOption) GetLogLevel() string
- func (c *ClientOption) GetMaxAge() int64
- func (c *ClientOption) GetMaxBackups() int64
- func (c *ClientOption) GetMaxSize() int64
- func (c *ClientOption) GetNamespace() string
- func (c *ClientOption) GetNotLoadCacheAtStart() bool
- func (c *ClientOption) GetPassword() string
- func (c *ClientOption) GetTimeout() uint64
- func (c *ClientOption) GetUpdateThreadNum() int
- func (c *ClientOption) GetUsername() string
- type Config
- type Global
- type GlobalConfig
- type Option
- type RollingConfig
- type Server
- type ServerConfig
- type Source
- type SourceConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateOptions ¶
func CreateOptions(cntCfg ClientConfig, cacheDir, logDir string) (options []constant.ClientOption)
func NewNaCosClientParam ¶
func NewNaCosClientParam(cfg *Config) vo.NacosClientParam
func NewNaCosConfigClient ¶
func NewNaCosConfigClient(conf *Config) config_client.IConfigClient
func NewNaCosDiscovery ¶
func NewNaCosDiscoveryWiths ¶
func NewNaCosNamingClient ¶
func NewNaCosNamingClient(conf *Config) naming_client.INamingClient
func NewNaCosRegistrar ¶
func NewNaCosRegistrarWiths ¶
func NewSources ¶
func NewSources[T any](sources ...T) []T
Types ¶
type ClientConfig ¶
type ClientOption ¶
type ClientOption struct { Username string `json:"username" yaml:"username"` Password string `json:"password" yaml:"password"` CacheDir string `json:"cache_dir" yaml:"cache_dir"` LogDir string `json:"log_dir" yaml:"log_dir"` LogLevel string `json:"log_level" yaml:"log_level"` Timeout uint64 `json:"timeout" yaml:"timeout"` Namespace string `json:"namespace" yaml:"namespace"` MaxBackups int64 `json:"max_backups" yaml:"max_backups"` MaxAge int64 `json:"rolling_max_age" yaml:"rolling_max_age"` MaxSize int64 `json:"rolling_max_size" yaml:"rolling_max_size"` UpdateThreadNum int `json:"update_thread_num" yaml:"update_thread_num"` NotLoadCacheAtStart bool `json:"not_load_cache_at_start" yaml:"not_load_cache_at_start"` }
func (*ClientOption) GetCacheDir ¶
func (c *ClientOption) GetCacheDir() string
func (*ClientOption) GetLogDir ¶
func (c *ClientOption) GetLogDir() string
func (*ClientOption) GetLogLevel ¶
func (c *ClientOption) GetLogLevel() string
func (*ClientOption) GetMaxAge ¶
func (c *ClientOption) GetMaxAge() int64
func (*ClientOption) GetMaxBackups ¶
func (c *ClientOption) GetMaxBackups() int64
func (*ClientOption) GetMaxSize ¶
func (c *ClientOption) GetMaxSize() int64
func (*ClientOption) GetNamespace ¶
func (c *ClientOption) GetNamespace() string
func (*ClientOption) GetNotLoadCacheAtStart ¶
func (c *ClientOption) GetNotLoadCacheAtStart() bool
func (*ClientOption) GetPassword ¶
func (c *ClientOption) GetPassword() string
func (*ClientOption) GetTimeout ¶
func (c *ClientOption) GetTimeout() uint64
func (*ClientOption) GetUpdateThreadNum ¶
func (c *ClientOption) GetUpdateThreadNum() int
func (*ClientOption) GetUsername ¶
func (c *ClientOption) GetUsername() string
type Config ¶
type Config struct { GlbCfg GlobalConfig `json:"global" yaml:"global"` SerCfgArr []ServerConfig `json:"servers" yaml:"servers"` CntCfg ClientConfig `json:"client_config" yaml:"client_config"` SrcCfgArr []SourceConfig `json:"sources" yaml:"sources"` }
func NewNaCosConfig ¶
func (*Config) GetGlobalConfig ¶
func (c *Config) GetGlobalConfig() GlobalConfig
type Global ¶
type Global struct {
AppName string `json:"app_name" yaml:"app_name"`
}
func (*Global) GetAppName ¶
type GlobalConfig ¶
type GlobalConfig interface {
GetAppName() string
}
type Option ¶
type Option func(*Config)
func WithClientOption ¶
func WithClientOption(opt *ClientOption) Option
func WithGlobal ¶
func WithServers ¶
func WithServers(serv ...ServerConfig) Option
func WithSources ¶
func WithSources(source ...SourceConfig) Option
type RollingConfig ¶
type Server ¶
type Server struct { Port uint64 `json:"port" yaml:"port"` Address string `json:"address" yaml:"address"` }
func (*Server) GetAddress ¶
type ServerConfig ¶
type Source ¶
type SourceConfig ¶
Click to show internal directories.
Click to hide internal directories.