Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidDataSource defines an error that the scheme has been registered ErrInvalidDataSource = errors.New("invalid data source, please make sure the scheme has been registered") // ErrInvalidUnmarshaller ... ErrInvalidUnmarshaller = errors.New("invalid unmarshaller, please make sure the config type is right") // ErrDefaultConfigNotExist 默认配置不存在 ErrDefaultConfigNotExist = errors.New("default config not exist") // DefaultScheme 默认协议 DefaultScheme = "file" )
Functions ¶
func NewDataSource ¶
func NewDataSource(configAddr string, watch bool) (econf.DataSource, econf.Unmarshaller, econf.ConfigType, error)
NewDataSource 根据配置地址,创建数据源
func Register ¶
func Register(scheme string, creator econf.DataSource)
Register registers a dataSource creator function to the registry
Types ¶
type DataSourceCreatorFunc ¶
type DataSourceCreatorFunc func() econf.DataSource
DataSourceCreatorFunc represents a dataSource creator function
Click to show internal directories.
Click to hide internal directories.