Documentation ¶
Index ¶
- type Mtail
- func (m *Mtail) Close()
- func (m *Mtail) InitLoader() error
- func (m *Mtail) OneShot(logfile string, print bool) (count int64, err error)
- func (m *Mtail) Run()
- func (m *Mtail) RunOneShot()
- func (m *Mtail) Serve()
- func (m *Mtail) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *Mtail) StartTailing() error
- func (m *Mtail) WaitForShutdown()
- func (m *Mtail) WriteMetrics(w io.Writer) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mtail ¶
type Mtail struct {
// contains filtered or unexported fields
}
Mtail contains the state of the main program object.
func (*Mtail) Close ¶
func (m *Mtail) Close()
Close handles the graceful shutdown of this mtail instance, ensuring that it only occurs once.
func (*Mtail) InitLoader ¶
InitLoader constructs a new program loader and performs the inital load of program files in the program directory.
func (*Mtail) OneShot ¶
OneShot reads the contents of a log file into the lines channel from start to finish, terminating the program at the end.
func (*Mtail) Run ¶
func (m *Mtail) Run()
Run starts Mtail in the configuration supplied in Options at creation.
func (*Mtail) RunOneShot ¶
func (m *Mtail) RunOneShot()
RunOneShot performs the work of the one_shot commandline flag; after compiling programs mtail will read all of the log files in full, once, dump the metric results at the end, and then exit.
func (*Mtail) Serve ¶
func (m *Mtail) Serve()
Serve begins the long-running mode of mtail, 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. It will continue to do so until it is signalled to exit.
func (*Mtail) StartTailing ¶
StartTailing constructs a new Tailer and commences sending log lines into the lines channel.
func (*Mtail) WaitForShutdown ¶
func (m *Mtail) WaitForShutdown()
WaitForShutdown handles shutdown requests from the system or the UI.
type Options ¶
type Options struct { Progs string LogPaths []string LogFds []int Port string OneShot bool OneShotMetrics bool CompileOnly bool DumpAst bool DumpAstTypes bool DumpBytecode bool SyslogUseCurrentYear bool 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 Mtail.