Documentation ¶
Overview ¶
Package manager for managing pipeline scripts
Package manager for managing pipeline scripts ¶
Package manager for managing pipeline scripts
Index ¶
- Constants
- func CategoryDirName() map[point.Category]string
- func CopyDefalutPatterns() map[string]string
- func FillScriptCategoryMap(scripts map[point.Category](map[string]string)) map[point.Category](map[string]string)
- func InitIPdb(dataDir string, pipelineCfg *PipelineCfg) (ipdb.IPdb, error)
- func InitLog()
- func InitStore(center *Manager, installDir string)
- func LoadDefaultScripts2Store(center *Manager, rootDir string)
- func LoadPatterns(patternDir string) error
- func LoadScript(centor *Manager, category point.Category, ns string, scripts map[string]string, ...)
- func LoadScripts(center *Manager, ns string, ...)
- func LoadScripts2StoreFromPlStructPath(center *Manager, ns, plPath string)
- func NSFindPriority(ns string) int
- func NewScripts(scripts map[string]string, scriptPath map[string]string, ns string, ...) (map[string]*PlScript, map[string]error)
- func ProcLoggingStatus(plpt ptinput.PlInputPt, disable bool, ignore []string)
- func ReadPlScriptFromDir(dirPath string) (map[string]string, map[string]string)
- func ReadPlScriptFromFile(fp string) (string, string, error)
- func ReadPlScriptFromPlStructPath(basePath string) (map[point.Category](map[string]string), map[point.Category](map[string]string))
- func SearchPlFilePathFormDir(dirPath string) map[string]string
- func SearchPlFilePathFromPlStructPath(basePath string) map[point.Category](map[string]string)
- type Manager
- type ManagerCfg
- type Option
- type PipelineCfg
- type PlScript
- func (script *PlScript) Category() point.Category
- func (script *PlScript) Engine() *plruntime.Script
- func (script PlScript) FilePath() string
- func (script *PlScript) NS() string
- func (script *PlScript) Name() string
- func (script *PlScript) Run(plpt ptinput.PlInputPt, signal plruntime.Signal, opt *Option) error
- func (script *PlScript) SetAggBuks(buks *plmap.AggBuckets)
- type ScriptStore
- func (store *ScriptStore) Count() int
- func (store *ScriptStore) GetWithNs(name, ns string) (*PlScript, bool)
- func (store *ScriptStore) IndexGet(name string) (*PlScript, bool)
- func (store *ScriptStore) LoadDotPScript2Store(ns string, dirPath string, filePath []string)
- func (store *ScriptStore) UpdateScriptsWithNS(ns string, namedScript map[string]string, scriptPath map[string]string) map[string]error
Constants ¶
View Source
const ( TypIPLOC = "iploc" TypGeoLite2 = "geolite2" )
View Source
const ( // pipeline关键字段. FieldTime = "time" FieldMessage = "message" FieldStatus = "status" PlLoggingSource = "source" DefaultStatus = "unknown" )
View Source
const ( DefaultScriptNS = "default" // 内置 pl script, 优先级最低 GitRepoScriptNS = "gitrepo" // git 管理的 pl script ConfdScriptNS = "confd" // confd 管理的 pl script RemoteScriptNS = "remote" // remote pl script,优先级最高 )
Variables ¶
This section is empty.
Functions ¶
func CategoryDirName ¶
func CopyDefalutPatterns ¶
func FillScriptCategoryMap ¶
func InitIPdb ¶
func InitIPdb(dataDir string, pipelineCfg *PipelineCfg) (ipdb.IPdb, error)
InitIPdb init ipdb instance.
func LoadPatterns ¶
func LoadScript ¶
func LoadScripts ¶
func LoadScripts(center *Manager, ns string, scripts, scriptPath map[point.Category](map[string]string))
LoadScripts is used to load and clean the script, parameter scripts example: {datakit.Logging: {ScriptName: ScriptContent},... }.
func NSFindPriority ¶
func NewScripts ¶
func ProcLoggingStatus ¶
func ReadPlScriptFromDir ¶
func SearchPlFilePathFormDir ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(cfg ManagerCfg) *Manager
func (*Manager) GetScriptRelation ¶
func (c *Manager) GetScriptRelation() *relation.ScriptRelation
func (*Manager) QueryScript ¶
type ManagerCfg ¶
type ManagerCfg struct {
// contains filtered or unexported fields
}
func NewManagerCfg ¶
func NewManagerCfg(upFn plmap.UploadFunc, gTags [][2]string) ManagerCfg
type PipelineCfg ¶
type PipelineCfg struct { IPdbAttr map[string]string `toml:"ipdb_attr"` IPdbType string `toml:"ipdb_type"` RemotePullInterval string `toml:"remote_pull_interval"` ReferTableURL string `toml:"refer_table_url"` ReferTablePullInterval string `toml:"refer_table_pull_interval"` UseSQLite bool `toml:"use_sqlite"` SQLiteMemMode bool `toml:"sqlite_mem_mode"` Offload *offload.OffloadConfig `toml:"offload"` }
type PlScript ¶
type PlScript struct {
// contains filtered or unexported fields
}
func (*PlScript) SetAggBuks ¶
func (script *PlScript) SetAggBuks(buks *plmap.AggBuckets)
type ScriptStore ¶
type ScriptStore struct {
// contains filtered or unexported fields
}
func NewScriptStore ¶
func NewScriptStore(category point.Category, cfg ManagerCfg) *ScriptStore
func (*ScriptStore) Count ¶
func (store *ScriptStore) Count() int
func (*ScriptStore) GetWithNs ¶
func (store *ScriptStore) GetWithNs(name, ns string) (*PlScript, bool)
func (*ScriptStore) LoadDotPScript2Store ¶
func (store *ScriptStore) LoadDotPScript2Store(ns string, dirPath string, filePath []string)
func (*ScriptStore) UpdateScriptsWithNS ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.