search

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2020 License: GPL-3.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewLogReader

func NewLogReader(reader io.Reader, gzipped bool, filter Filter) (*logReader, error)

func NewSearchLog

func NewSearchLog(entriesHandler func(*entry.Entry) (continueRead bool, err error), baseDir string) *searchLog

Types

type Filter

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

func NewFilter

func NewFilter(req SearchRequest) (Filter, error)

type SearchRequest

type SearchRequest struct {
	ModuleName string `valid:"required~Required"`
	From       time.Time
	To         time.Time
	Host       []string
	Event      []string
	Level      []string
	Limit      int `valid:"required~Required,range(1|10000)"`
	Offset     int
}

type SearchResponse added in v1.1.2

type SearchResponse struct {
	ModuleName string `json:",omitempty"`
	Host       string `json:",omitempty"`
	Event      string `json:",omitempty"`
	Level      string `json:",omitempty"`
	Time       string `json:",omitempty"`
	Request    string `json:",omitempty"`
	Response   string `json:",omitempty"`
	ErrorText  string `json:",omitempty"`
}

type SearchWithCursorRequest added in v1.3.0

type SearchWithCursorRequest struct {
	Request   SearchRequest
	CursorId  string
	BatchSize int `valid:"required~Required,range(1|10000)"`
}

type SearchWithCursorResponse added in v1.3.0

type SearchWithCursorResponse struct {
	CursorId string
	Items    []SearchResponse
	HasMore  bool
}

type SyncSearchLog added in v1.3.0

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

func NewSyncSearchService added in v1.3.0

func NewSyncSearchService(req SearchRequest, baseDir string) (*SyncSearchLog, error)

func (*SyncSearchLog) Next added in v1.3.0

func (s *SyncSearchLog) Next() (*entry.Entry, bool, error)

return next matched log entry, never return io.EOF, if data source exhausted return false in second param idempotent return the same error while reading or opening file

Jump to

Keyboard shortcuts

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