qiniu

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2018 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const (
	LogHeadPrefix        = "prefix"
	LogHeadDate          = "date"
	LogHeadTime          = "time"
	LogHeadLevel         = "level"
	LogHeadReqid  string = "reqid"
	LogHeadFile          = "file"
	LogHeadLog           = "log" //默认在最后,不能改变顺序
)

Variables

View Source
var (
	HeaderPattern = map[string]string{
		LogHeadDate:  "^[1-9]\\d{3}/[0-1]\\d/[0-3]\\d$",
		LogHeadTime:  "^[0-2]\\d:[0-6]\\d:[0-6]\\d(\\.\\d{6})?$",
		LogHeadReqid: "^\\[\\w+\\]\\[\\w+\\]$",
		LogHeadLevel: "^\\[[A-Z]+\\]$",
		LogHeadFile:  ":\\d+:$",
	}
	CompliedPatterns map[string]*regexp.Regexp
)

Functions

func NewParser

func NewParser(c conf.MapConf) (parser.Parser, error)

Types

type Parser

type Parser struct {
	// contains filtered or unexported fields
}

func (*Parser) GetParser

func (p *Parser) GetParser(head string) (func(string) (string, string, error), error)

func (*Parser) Name

func (p *Parser) Name() string

func (*Parser) Parse

func (p *Parser) Parse(lines []string) ([]Data, error)

func (*Parser) Type

func (p *Parser) Type() string

Jump to

Keyboard shortcuts

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