Documentation
¶
Index ¶
- Constants
- func FormatJsonValue(iValue interface{}) interface{}
- func GetHost() string
- func GetString(j *sjson.Json, key string, required bool) (string, error)
- func GetStringArray(j *sjson.Json, key string) ([]string, error)
- 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 NewListPathHandler() http.HandlerFunc
- func NewListStatsHandler(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 NewTestTaskHandler() http.HandlerFunc
- func NewUpdateTaskHandler(pecker *Pecker) http.HandlerFunc
- func NewVersionHandler() http.HandlerFunc
- func OpenDB(path string) (err error)
- func SelectRandom(candidates []string) (string, error)
- func SplitString(content, delims string) []string
- func TestPeckTask(config *PeckTaskConfig) ([]map[string]interface{}, error)
- type 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
- type ElasticSearchSender
- type LogPeckConfig
- type LogStat
- type 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
- type PeckField
- type PeckFilter
- type PeckTask
- 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) ProcessTest(content string) (map[string]interface{}, error)
- func (p *PeckTask) Start()
- func (p *PeckTask) Stop()
- type PeckTaskConfig
- type PeckTaskLimit
- type PeckTaskStat
- type Pecker
- func (p *Pecker) AddPeckTask(config *PeckTaskConfig, stat *PeckTaskStat) error
- func (p *Pecker) GetStat() *PeckerStat
- func (p *Pecker) ListPeckTask() ([]PeckTaskConfig, error)
- func (p *Pecker) ListTaskStats() ([]PeckTaskStat, 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
- type Stat
- type TestModule
Constants ¶
View Source
const VersionString string = "0.2.0"
Variables ¶
This section is empty.
Functions ¶
func FormatJsonValue ¶
func FormatJsonValue(iValue interface{}) interface{}
func GetStringArray ¶ added in v0.0.3
func InitConfig ¶
func LogExecTime ¶
func NewAddTaskHandler ¶
func NewAddTaskHandler(pecker *Pecker) http.HandlerFunc
func NewListPathHandler ¶ added in v0.0.3
func NewListPathHandler() http.HandlerFunc
func NewListStatsHandler ¶ added in v0.0.3
func NewListStatsHandler(pecker *Pecker) http.HandlerFunc
func NewListTaskHandler ¶
func NewListTaskHandler(pecker *Pecker) http.HandlerFunc
func NewRemoveTaskHandler ¶
func NewRemoveTaskHandler(pecker *Pecker) http.HandlerFunc
func NewStartTaskHandler ¶
func NewStartTaskHandler(pecker *Pecker) http.HandlerFunc
func NewStopTaskHandler ¶
func NewStopTaskHandler(pecker *Pecker) http.HandlerFunc
func NewTestTaskHandler ¶ added in v0.0.3
func NewTestTaskHandler() http.HandlerFunc
func NewUpdateTaskHandler ¶
func NewUpdateTaskHandler(pecker *Pecker) http.HandlerFunc
func NewVersionHandler ¶ added in v0.0.3
func NewVersionHandler() http.HandlerFunc
func SelectRandom ¶
func SplitString ¶
func TestPeckTask ¶ added in v0.0.3
func TestPeckTask(config *PeckTaskConfig) ([]map[string]interface{}, error)
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
func GetDBHandler ¶
func GetDBHandler() *DB
func (*DB) GetAllConfigs ¶
func (p *DB) GetAllConfigs() (configs []PeckTaskConfig, err error)
func (*DB) GetAllStats ¶
func (p *DB) GetAllStats() (stats []PeckTaskStat, err error)
func (*DB) RemoveConfig ¶
func (*DB) RemoveStat ¶
func (*DB) SaveConfig ¶
func (p *DB) SaveConfig(config *PeckTaskConfig) error
func (*DB) SaveStat ¶
func (p *DB) SaveStat(stat *PeckTaskStat) error
type ElasticSearchConfig ¶
type ElasticSearchConfig struct { Hosts []string Index string Type string Mapping map[string]interface{} }
func ParseESConfig ¶ added in v0.0.3
func ParseESConfig(j *sjson.Json) (config ElasticSearchConfig, e error)
type ElasticSearchSender ¶
type ElasticSearchSender struct {
// contains filtered or unexported fields
}
func NewElasticSearchSender ¶
func NewElasticSearchSender(config *ElasticSearchConfig, fields []PeckField) *ElasticSearchSender
func (*ElasticSearchSender) GetIndexName ¶ added in v0.0.3
func (p *ElasticSearchSender) GetIndexName() (indexName string)
func (*ElasticSearchSender) InitMapping ¶ added in v0.0.3
func (p *ElasticSearchSender) InitMapping() error
func (*ElasticSearchSender) Send ¶
func (p *ElasticSearchSender) Send(fields map[string]interface{})
type LogPeckConfig ¶
type LogPeckConfig struct { Port int32 `toml:"port"` LogLevel string `toml:"log_level"` MaxTaskNum int32 `toml:"max_task_num"` DatabaseFile string `toml:"database_file"` PeckTaskLimit PeckTaskLimit `toml:"peck_task_limit"` }
var Config LogPeckConfig
type LogStat ¶
type LogStat struct { LogPath string PeckTaskConfigs []PeckTaskConfig PeckTaskStats []PeckTaskStat }
type LogTask ¶
type LogTask struct { LogPath string // contains filtered or unexported fields }
func NewLogTask ¶
func (*LogTask) AddPeckTask ¶
func (*LogTask) Exist ¶
func (p *LogTask) Exist(config *PeckTaskConfig) bool
func (*LogTask) RemovePeckTask ¶
func (p *LogTask) RemovePeckTask(config *PeckTaskConfig) error
func (*LogTask) StartPeckTask ¶
func (p *LogTask) StartPeckTask(config *PeckTaskConfig) error
func (*LogTask) StopPeckTask ¶
func (p *LogTask) StopPeckTask(config *PeckTaskConfig) error
func (*LogTask) UpdatePeckTask ¶
type MockLog ¶
func NewMockLog ¶
type PeckFilter ¶
type PeckFilter struct {
// contains filtered or unexported fields
}
func NewPeckFilter ¶
func NewPeckFilter(filterExpr string) *PeckFilter
func (*PeckFilter) Drop ¶
func (p *PeckFilter) Drop(str string) bool
type PeckTask ¶
type PeckTask struct { Config PeckTaskConfig Stat PeckTaskStat // contains filtered or unexported fields }
func NewPeckTask ¶
func NewPeckTask(c *PeckTaskConfig, s *PeckTaskStat) (*PeckTask, error)
func (*PeckTask) ExtractFields ¶
func (*PeckTask) ExtractFieldsFromJson ¶
func (*PeckTask) ExtractFieldsFromPlain ¶
func (*PeckTask) ProcessTest ¶ added in v0.0.3
type PeckTaskConfig ¶
type PeckTaskConfig struct { Name string LogPath string ESConfig ElasticSearchConfig LogFormat string FilterExpr string Fields []PeckField Delimiters string Test TestModule }
func (*PeckTaskConfig) Check ¶
func (p *PeckTaskConfig) Check() error
func (*PeckTaskConfig) Unmarshal ¶ added in v0.0.3
func (p *PeckTaskConfig) Unmarshal(jsonStr []byte) (e error)
type PeckTaskLimit ¶
type PeckTaskStat ¶
type Pecker ¶
type Pecker struct {
// contains filtered or unexported fields
}
func (*Pecker) AddPeckTask ¶
func (p *Pecker) AddPeckTask(config *PeckTaskConfig, stat *PeckTaskStat) error
func (*Pecker) GetStat ¶
func (p *Pecker) GetStat() *PeckerStat
func (*Pecker) ListPeckTask ¶
func (p *Pecker) ListPeckTask() ([]PeckTaskConfig, error)
func (*Pecker) ListTaskStats ¶ added in v0.0.3
func (p *Pecker) ListTaskStats() ([]PeckTaskStat, error)
func (*Pecker) RemovePeckTask ¶
func (p *Pecker) RemovePeckTask(config *PeckTaskConfig) error
func (*Pecker) StartPeckTask ¶
func (p *Pecker) StartPeckTask(config *PeckTaskConfig) error
func (*Pecker) StopPeckTask ¶
func (p *Pecker) StopPeckTask(config *PeckTaskConfig) error
func (*Pecker) UpdatePeckTask ¶
func (p *Pecker) UpdatePeckTask(config *PeckTaskConfig) error
type PeckerStat ¶
type TestModule ¶ added in v0.0.3
Source Files
¶
Click to show internal directories.
Click to hide internal directories.