manager

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2021 License: MIT Imports: 7 Imported by: 6

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

Jump to

Keyboard shortcuts

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