Versions in this module Expand all Collapse all v0 v0.0.2 Aug 2, 2017 Changes in this version + const ESTimestampProp + const VersionString + func FormatJsonValue(iValue interface{}) interface + func GetHost() string + func GetIndexName(prototype string) string + func HttpCall(method, url string, bodyString string) + func InitConfig(file *string) bool + func LogExecTime(start time.Time, prefix string) + func NewAddTaskHandler(pecker *Pecker) http.HandlerFunc + func NewListTaskHandler(pecker *Pecker) http.HandlerFunc + func NewRemoveTaskHandler(pecker *Pecker) http.HandlerFunc + func NewStartTaskHandler(pecker *Pecker) http.HandlerFunc + func NewStopTaskHandler(pecker *Pecker) http.HandlerFunc + func NewUpdateTaskHandler(pecker *Pecker) http.HandlerFunc + func OpenDB(path string) (err error) + func SelectRandom(candidates []string) (string, error) + func SplitString(content, delims string) []string + type DB struct + func GetDBHandler() *DB + func (p *DB) Close() error + func (p *DB) GetAllConfigs() (configs []PeckTaskConfig, err error) + func (p *DB) GetAllStats() (stats []PeckTaskStat, err error) + func (p *DB) GetConfig(logPath, name string) (*PeckTaskConfig, error) + func (p *DB) GetStat(logPath, name string) (*PeckTaskStat, error) + func (p *DB) RemoveConfig(logPath, name string) error + func (p *DB) RemoveStat(logPath, name string) error + func (p *DB) SaveConfig(config *PeckTaskConfig) error + func (p *DB) SaveStat(stat *PeckTaskStat) error + type ElasticSearchConfig struct + Hosts []string + Index string + Type string + type ElasticSearchSender struct + func NewElasticSearchSender(config *ElasticSearchConfig) *ElasticSearchSender + func (p *ElasticSearchSender) Init(taskConfig *PeckTaskConfig) error + func (p *ElasticSearchSender) Send(fields map[string]interface{}) + type LogPeckConfig struct + DatabaseFile string + MaxTaskNum int32 + PeckTaskLimit PeckTaskLimit + Port int32 + var Config LogPeckConfig + type LogStat struct + LogPath string + PeckTaskConfigs []PeckTaskConfig + PeckTaskStats []PeckTaskStat + type LogTask struct + LogPath string + func NewLogTask(path string) *LogTask + func (p *LogTask) AddPeckTask(task *PeckTask) error + func (p *LogTask) Close() error + func (p *LogTask) Empty() bool + func (p *LogTask) Exist(config *PeckTaskConfig) bool + func (p *LogTask) GetStat() *LogStat + func (p *LogTask) IsStop() bool + func (p *LogTask) RemovePeckTask(config *PeckTaskConfig) error + func (p *LogTask) Start() error + func (p *LogTask) StartPeckTask(config *PeckTaskConfig) error + func (p *LogTask) Stop() error + func (p *LogTask) StopPeckTask(config *PeckTaskConfig) error + func (p *LogTask) UpdatePeckTask(task *PeckTask) error + type MockLog struct + IsRunning bool + Path string + func NewMockLog(path string) (*MockLog, error) + func (p *MockLog) Close() + func (p *MockLog) Run() error + func (p *MockLog) Stop() + type PeckField struct + ESType string + Name string + Type string + Value string + func (p *PeckField) Check() error + type PeckFilter struct + func NewPeckFilter(filterExpr string) *PeckFilter + func (p *PeckFilter) Drop(str string) bool + type PeckTask struct + Config PeckTaskConfig + Stat PeckTaskStat + func NewPeckTask(c *PeckTaskConfig, s *PeckTaskStat) (*PeckTask, error) + func (p *PeckTask) ExtractFields(content string) map[string]interface{} + func (p *PeckTask) ExtractFieldsFromJson(content string) map[string]interface{} + func (p *PeckTask) ExtractFieldsFromPlain(content string) map[string]interface{} + func (p *PeckTask) IsStop() bool + func (p *PeckTask) Process(content string) + func (p *PeckTask) Start() + func (p *PeckTask) Stop() + type PeckTaskConfig struct + Delimiters string + ESConfig ElasticSearchConfig + Fields []PeckField + FilterExpr string + LogFormat string + LogPath string + Name string + func (p *PeckTaskConfig) Check() error + type PeckTaskLimit struct + MaxBytesPerSec int64 + MaxLinesPerSec int64 + type PeckTaskStat struct + BytesPerSec int64 + BytesTotal int64 + LinesPerSec int64 + LinesTotal int64 + LogPath string + Name string + Stop bool + type Pecker struct + func NewPecker(db *DB) (*Pecker, error) + func (p *Pecker) AddPeckTask(config *PeckTaskConfig, stat *PeckTaskStat) error + func (p *Pecker) GetStat() *PeckerStat + func (p *Pecker) ListPeckTask() ([]PeckTaskConfig, error) + func (p *Pecker) RemovePeckTask(config *PeckTaskConfig) error + func (p *Pecker) Start() error + func (p *Pecker) StartPeckTask(config *PeckTaskConfig) error + func (p *Pecker) StopPeckTask(config *PeckTaskConfig) error + func (p *Pecker) UpdatePeckTask(config *PeckTaskConfig) error + type PeckerStat struct + LogStats []LogStat + Name string + Stat Stat + type Stat struct + BytesPerSec int64 + BytesTotal int64 + LinesPerSec int64 + LinesTotal int64 + Name string v0.0.1 Apr 14, 2017