file

package
v3.0.3-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2022 License: Apache-2.0 Imports: 20 Imported by: 25

Documentation

Overview

Package file implements config center around file system.

Index

Constants

View Source
const (
	ParamNamePrefix               = "dubbo.config-center."
	ConfigCenterDirParamName      = ParamNamePrefix + "dir"
	ConfigCenterEncodingParamName = ParamNamePrefix + "encoding"
)

Variables

This section is empty.

Functions

func Home

func Home() (string, error)

Home returns the home directory for the executing user.

This uses an OS-specific method for discovering the home directory. An error is returned if a home directory cannot be detected.

Types

type CacheListener

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

CacheListener is file watcher

func NewCacheListener

func NewCacheListener(rootPath string) *CacheListener

NewCacheListener creates a new CacheListener

func (*CacheListener) AddListener

func (cl *CacheListener) AddListener(key string, listener config_center.ConfigurationListener)

AddListener will add a listener if loaded if you watcher a file or directory not exist, will error with no such file or directory

func (*CacheListener) Close

func (cl *CacheListener) Close() error

Close will remove key listener and close watcher

func (*CacheListener) RemoveListener

func (cl *CacheListener) RemoveListener(key string, listener config_center.ConfigurationListener)

RemoveListener will delete a listener if loaded

type FileSystemDynamicConfiguration

type FileSystemDynamicConfiguration struct {
	config_center.BaseDynamicConfiguration
	// contains filtered or unexported fields
}

func (*FileSystemDynamicConfiguration) AddListener

AddListener Add listener

func (*FileSystemDynamicConfiguration) Close

func (fsdc *FileSystemDynamicConfiguration) Close() error

Close close file watcher

func (*FileSystemDynamicConfiguration) GetConfigKeysByGroup

func (fsdc *FileSystemDynamicConfiguration) GetConfigKeysByGroup(group string) (*gxset.HashSet, error)

GetConfigKeysByGroup will return all keys with the group

func (*FileSystemDynamicConfiguration) GetInternalProperty

func (fsdc *FileSystemDynamicConfiguration) GetInternalProperty(key string, opts ...config_center.Option) (string,
	error)

GetInternalProperty get value by key in Default properties file(dubbo.properties)

func (*FileSystemDynamicConfiguration) GetPath

func (fsdc *FileSystemDynamicConfiguration) GetPath(key string, group string) string

GetPath get path

func (*FileSystemDynamicConfiguration) GetProperties

func (fsdc *FileSystemDynamicConfiguration) GetProperties(key string, opts ...config_center.Option) (string, error)

GetProperties get properties file

func (*FileSystemDynamicConfiguration) GetRule

func (fsdc *FileSystemDynamicConfiguration) GetRule(key string, opts ...config_center.Option) (string, error)

GetRule get Router rule properties file

func (*FileSystemDynamicConfiguration) Parser

Parser Get Parser

func (*FileSystemDynamicConfiguration) PublishConfig

func (fsdc *FileSystemDynamicConfiguration) PublishConfig(key string, group string, value string) error

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

func (*FileSystemDynamicConfiguration) RemoveConfig

func (fsdc *FileSystemDynamicConfiguration) RemoveConfig(key string, group string) error

RemoveConfig will remove tconfig_center/nacos/impl_testhe config whit hte (key, group)

func (*FileSystemDynamicConfiguration) RemoveListener

RemoveListener Remove listener

func (*FileSystemDynamicConfiguration) RootPath

func (fsdc *FileSystemDynamicConfiguration) RootPath() string

RootPath get root path

func (*FileSystemDynamicConfiguration) SetParser

SetParser Set Parser

Jump to

Keyboard shortcuts

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