config_center

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: Apache-2.0 Imports: 9 Imported by: 12

Documentation

Index

Constants

View Source
const (
	// DEFAULT_GROUP: default group
	DEFAULT_GROUP = "dubbo"
	// DEFAULT_CONFIG_TIMEOUT: default config timeout
	DEFAULT_CONFIG_TIMEOUT = "10s"
)

//////////////////////////////////////// DynamicConfiguration ////////////////////////////////////////

Variables

This section is empty.

Functions

func GetRuleKey added in v1.4.0

func GetRuleKey(url common.URL) string

GetRuleKey The format is '{interfaceName}:[version]:[group]'

Types

type ConfigChangeEvent added in v1.2.0

type ConfigChangeEvent struct {
	Key        string
	Value      interface{}
	ConfigType remoting.EventType
}

ConfigChangeEvent for changing listener's event

func (ConfigChangeEvent) String added in v1.2.0

func (c ConfigChangeEvent) String() string

type ConfigurationListener added in v1.2.0

type ConfigurationListener interface {
	// Process the notification event once there's any change happens on the config
	Process(*ConfigChangeEvent)
}

ConfigurationListener for changing listener's event

type Configurator added in v1.2.0

type Configurator interface {
	GetUrl() *common.URL
	Configure(url *common.URL)
}

Configurator supports GetUrl and constructor

type DynamicConfiguration

type DynamicConfiguration interface {
	Parser() parser.ConfigurationParser
	SetParser(parser.ConfigurationParser)
	AddListener(string, ConfigurationListener, ...Option)
	RemoveListener(string, ConfigurationListener, ...Option)
	// GetProperties get properties file
	GetProperties(string, ...Option) (string, error)

	// GetRule get Router rule properties file
	GetRule(string, ...Option) (string, error)

	// GetInternalProperty get value by key in Default properties file(dubbo.properties)
	GetInternalProperty(string, ...Option) (string, error)

	// PublishConfig will publish the config with the (key, group, value) pair
	PublishConfig(string, string, string) error

	// GetConfigKeysByGroup will return all keys with the group
	GetConfigKeysByGroup(group string) (*gxset.HashSet, error)
}

DynamicConfiguration for modify listener and get properties file

type DynamicConfigurationFactory

type DynamicConfigurationFactory interface {
	GetDynamicConfiguration(*common.URL) (DynamicConfiguration, error)
}

DynamicConfigurationFactory gets the DynamicConfiguration

type MockDynamicConfiguration added in v1.2.0

type MockDynamicConfiguration struct {
	// contains filtered or unexported fields
}

MockDynamicConfiguration uses to parse content and defines listener

func (*MockDynamicConfiguration) AddListener added in v1.2.0

func (c *MockDynamicConfiguration) AddListener(key string, listener ConfigurationListener, _ ...Option)

AddListener adds a listener for MockDynamicConfiguration

func (*MockDynamicConfiguration) GetConfig added in v1.2.0

func (c *MockDynamicConfiguration) GetConfig(_ string, _ ...Option) (string, error)

GetConfig returns content of MockDynamicConfiguration

func (*MockDynamicConfiguration) GetConfigKeysByGroup added in v1.5.0

func (c *MockDynamicConfiguration) GetConfigKeysByGroup(group string) (*gxset.HashSet, error)

GetConfigKeysByGroup will return all keys with the group

func (*MockDynamicConfiguration) GetConfigs added in v1.2.0

func (c *MockDynamicConfiguration) GetConfigs(key string, opts ...Option) (string, error)

GetConfigs For zookeeper, getConfig and getConfigs have the same meaning.

func (*MockDynamicConfiguration) GetInternalProperty added in v1.3.0

func (c *MockDynamicConfiguration) GetInternalProperty(key string, opts ...Option) (string, error)

GetInternalProperty For zookeeper, getConfig and getConfigs have the same meaning.

func (*MockDynamicConfiguration) GetProperties added in v1.3.0

func (c *MockDynamicConfiguration) GetProperties(_ string, _ ...Option) (string, error)

GetProperties gets content of MockDynamicConfiguration

func (*MockDynamicConfiguration) GetRule added in v1.3.0

func (c *MockDynamicConfiguration) GetRule(key string, opts ...Option) (string, error)

GetRule gets properties of MockDynamicConfiguration

func (*MockDynamicConfiguration) MockApplicationConfigEvent added in v1.2.0

func (c *MockDynamicConfiguration) MockApplicationConfigEvent()

MockApplicationConfigEvent returns ConfiguratorConfig

func (*MockDynamicConfiguration) MockServiceConfigEvent added in v1.2.0

func (c *MockDynamicConfiguration) MockServiceConfigEvent()

MockServiceConfigEvent returns ConfiguratorConfig

func (*MockDynamicConfiguration) Parser added in v1.2.0

Parser returns a parser of MockDynamicConfiguration

func (*MockDynamicConfiguration) PublishConfig added in v1.5.0

func (c *MockDynamicConfiguration) PublishConfig(string, string, string) error

PublishConfig will publish the config with the (key, group, value) pair

func (*MockDynamicConfiguration) RemoveListener added in v1.2.0

func (c *MockDynamicConfiguration) RemoveListener(_ string, _ ConfigurationListener, _ ...Option)

RemoveListener removes the listener for MockDynamicConfiguration

func (*MockDynamicConfiguration) SetParser added in v1.2.0

SetParser sets parser of MockDynamicConfiguration

type MockDynamicConfigurationFactory

type MockDynamicConfigurationFactory struct {
	Content string
}

MockDynamicConfigurationFactory defines content

func (*MockDynamicConfigurationFactory) GetDynamicConfiguration

func (f *MockDynamicConfigurationFactory) GetDynamicConfiguration(_ *common.URL) (DynamicConfiguration, error)

GetDynamicConfiguration returns a DynamicConfiguration

type Option

type Option func(*Options)

Option ...

func WithGroup

func WithGroup(group string) Option

WithGroup assigns group to opt.Group

func WithTimeout

func WithTimeout(time time.Duration) Option

WithTimeout assigns time to opt.Timeout

type Options

type Options struct {
	Group   string
	Timeout time.Duration
}

Options ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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