engine

package
v0.0.0-...-8a6d2ef Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2018 License: Apache-2.0 Imports: 17 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c Config, source source.Sources, parser parse.Parse, cache gcache.Cache) http.Handler

New returns a new websocket handler

Types

type Config

type Config struct {
	ContentBatchSize  int           `json:"content_batch_size"`
	ContentBatchTime  time.Duration `json:"content_batch_time"`
	SearchMaxSize     int           `json:"search_max_size"`
	CacheExpiration   time.Duration `json:"cache_expiration"`
	ExcludeExtensions []string      `json:"exclude_extensions"`
	ExcludeDirs       []string      `json:"exclude_dirs"`
}

Config are global configuration parameter for logserver

type File

type File struct {
	Key   string `json:"key"`
	Path  Path   `json:"path"`
	IsDir bool   `json:"is_dir"`
	// Instances are all the instances of the same file in different file systems
	Instances []FileInstance `json:"instances"`
}

File describes a file in multiple file systems

func (File) FilterSources

func (f File) FilterSources(sources map[string]bool) *File

type FileInstance

type FileInstance struct {
	Size int64  `json:"size"`
	FS   string `json:"fs"`
}

FileInstance describe a file on a filesystem

type Meta

type Meta struct {
	ID     int    `json:"id"`
	Action string `json:"action"`
	FS     string `json:"fs,omitempty"`
	Path   Path   `json:"path,omitempty"`
}

Meta is request/response metadata

type Path

type Path []string

Path describes a file path Each directory or file is an item in the slice

type Request

type Request struct {
	Meta         `json:"meta"`
	Path         Path      `json:"path"`
	Regexp       string    `json:"regexp"`
	FilterSource []string  `json:"filter_fs"`
	FilterTime   TimeRange `json:"filter_time"`
	// contains filtered or unexported fields
}

Request from client

func (*Request) Init

func (r *Request) Init()

type Response

type Response struct {
	Meta     `json:"meta"`
	Lines    []parse.Log `json:"lines,omitempty"`
	Files    []*File     `json:"tree,omitempty"`
	Error    string      `json:"error,omitempty"`
	Finished bool        `json:"finished,omitempty"`
}

Response from the server

func (Response) FilterSources

func (r Response) FilterSources(sources map[string]bool) *Response

type TimeRange

type TimeRange struct {
	Start *time.Time `json:"start"`
	End   *time.Time `json:"end"`
}

Jump to

Keyboard shortcuts

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