Documentation ¶
Index ¶
- type MtailServer
- func (m *MtailServer) Close() error
- func (m *MtailServer) InitLoader() error
- func (m *MtailServer) Run() error
- func (m *MtailServer) Serve()
- func (m *MtailServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *MtailServer) StartTailing() error
- func (m *MtailServer) WaitForShutdown()
- func (m *MtailServer) WriteMetrics(w io.Writer) error
- type Options
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.