Documentation
¶
Overview ¶
Package loader provides ConfigurationFileHandler and RemoteConfigurationLoader, the ConfigurationFileHandler is used for load config from cache and save remote config to cache, the RemoteConfigurationLoader is used for load config from remote etcd.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigurationFileHandler ¶
type ConfigurationFileHandler struct {
// contains filtered or unexported fields
}
ConfigurationFileHandler for cacheConfig load and save
func NewConfigurationFileHandler ¶
func NewConfigurationFileHandler() *ConfigurationFileHandler
func (*ConfigurationFileHandler) Load ¶
func (h *ConfigurationFileHandler) Load(hashCode string) *config.RemoteClusterConfiguration
Load local cache config when get remote config from etcd failed
func (*ConfigurationFileHandler) Save ¶
func (h *ConfigurationFileHandler) Save(config *config.RemoteClusterConfiguration, hashCode string)
Save remote config to local
type RemoteConfigurationLoader ¶
type RemoteConfigurationLoader struct {
// contains filtered or unexported fields
}
RemoteConfigurationLoader to load remote configuration from etcd
func NewRemoteConfigurationLoader ¶
func NewRemoteConfigurationLoader(props *mas.PropertiesConfiguration, etcdConfiguration *etcd.EtcdConfiguration) *RemoteConfigurationLoader
@param props is yaml properties configuration entity @param etcdConfiguration is yaml etcd configuration entity
func (*RemoteConfigurationLoader) AddRouterListener ¶
func (l *RemoteConfigurationLoader) AddRouterListener(listener config.RouterConfigurationListener)
AddRouterListener add a router configuration listener
func (*RemoteConfigurationLoader) Close ¶
func (l *RemoteConfigurationLoader) Close() error
Close loader's etcdClient and set loader's listeners nil
func (*RemoteConfigurationLoader) GetConfiguration ¶
func (l *RemoteConfigurationLoader) GetConfiguration(hashCode string) *config.RemoteClusterConfiguration
GetConfiguration form etcd, or from local cache
func (*RemoteConfigurationLoader) Init ¶
func (l *RemoteConfigurationLoader) Init()
Init etcd start watch activeKey