Documentation ¶
Overview ¶
Package filesource created on 2017/6/22.
Index ¶
- Constants
- type ConfigInfo
- type FileSource
- type FileSourceTypes
- type Source
- func (fSource *Source) AddDimensionInfo(labels map[string]string) error
- func (fSource *Source) AddFile(p string, priority uint32, handle util.FileHandler) error
- func (fSource *Source) Cleanup() error
- func (fSource *Source) Delete(key string) error
- func (fSource *Source) GetConfigurationByKey(key string) (interface{}, error)
- func (fSource *Source) GetConfigurations() (map[string]interface{}, error)
- func (fSource *Source) GetPriority() int
- func (*Source) GetSourceName() string
- func (fSource *Source) Set(key string, value interface{}) error
- func (fSource *Source) SetPriority(priority int)
- func (fSource *Source) Watch(callback source.EventHandler) error
Constants ¶
View Source
const ( //FileConfigSourceConst is a variable of type string FileConfigSourceConst = "FileSource" //DefaultFilePriority is a variable of type string DefaultFilePriority = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigInfo ¶
type ConfigInfo struct { FilePath string Value interface{} }
ConfigInfo is s struct
type FileSource ¶
type FileSource interface { source.ConfigSource AddFile(filePath string, priority uint32, handler util.FileHandler) error }
FileSource is a interface
func NewFileSource ¶
func NewFileSource() FileSource
NewFileSource creates a source which can handler local files
type FileSourceTypes ¶
type FileSourceTypes string
FileSourceTypes is a string
const ( //RegularFile is a variable of type string RegularFile FileSourceTypes = "RegularFile" //Directory is a variable of type string Directory FileSourceTypes = "Directory" //InvalidFileType is a variable of type string InvalidFileType FileSourceTypes = "InvalidType" )
type Source ¶
type Source struct { Configurations map[string]*ConfigInfo sync.RWMutex // contains filtered or unexported fields }
Source is file source
func (*Source) AddDimensionInfo ¶
AddDimensionInfo is none function
func (*Source) GetConfigurationByKey ¶
GetConfigurationByKey get one key value
func (*Source) GetConfigurations ¶
GetConfigurations get all configs
func (*Source) GetSourceName ¶
GetSourceName get name of source
func (*Source) SetPriority ¶
SetPriority custom priority
Click to show internal directories.
Click to hide internal directories.