mtail

package
v3.0.0-rc9+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2018 License: Apache-2.0 Imports: 19 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MtailServer

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

MtailServer contains the state of the main program object.

func New

func New(o Options) (*MtailServer, error)

New creates an MtailServer from the supplied Options.

func (*MtailServer) Close

func (m *MtailServer) Close() error

Close handles the graceful shutdown of this mtail instance, ensuring that it only occurs once.

func (*MtailServer) InitLoader

func (m *MtailServer) InitLoader() error

InitLoader constructs a new program loader and performs the inital load of program files in the program directory.

func (*MtailServer) Run

func (m *MtailServer) Run() error

Run starts MtailServer's primary function, in which it watches the log files for changes and sends any new lines found into the lines channel for pick up by the virtual machines. If OneShot mode is enabled, it will exit.

func (*MtailServer) Serve

func (m *MtailServer) Serve()

Serve begins the webserver and awaits a shutdown instruction.

func (*MtailServer) ServeHTTP

func (m *MtailServer) ServeHTTP(w http.ResponseWriter, r *http.Request)

func (*MtailServer) StartTailing

func (m *MtailServer) StartTailing() error

StartTailing constructs a new Tailer and commences sending log lines into the lines channel.

func (*MtailServer) WaitForShutdown

func (m *MtailServer) WaitForShutdown()

WaitForShutdown handles shutdown requests from the system or the UI.

func (*MtailServer) WriteMetrics

func (m *MtailServer) WriteMetrics(w io.Writer) error

WriteMetrics dumps the current state of the metrics store in JSON format to the io.Writer.

type Options

type Options struct {
	Progs                string
	LogPathPatterns      []string
	LogFds               []int
	BindAddress          string
	OneShot              bool
	CompileOnly          bool
	DumpAst              bool
	DumpAstTypes         bool
	DumpBytecode         bool
	SyslogUseCurrentYear bool
	OverrideLocation     *time.Location
	OmitMetricSource     bool
	OmitProgLabel        bool

	BuildInfo string

	Store *metrics.Store

	W  watcher.Watcher // Not required, will use watcher.LogWatcher if zero.
	FS afero.Fs        // Not required, will use afero.OsFs if zero.
}

Options contains all the parameters necessary for constructing a new MtailServer.

Jump to

Keyboard shortcuts

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