loader

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

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

Load local cache config when get remote config from etcd failed

func (*ConfigurationFileHandler) Save

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

Jump to

Keyboard shortcuts

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