Documentation
¶
Index ¶
- func BindAddress(address, port string) func(*MtailServer) error
- func BuildInfo(info string) func(*MtailServer) error
- func CompileOnly(m *MtailServer) error
- func DumpAst(m *MtailServer) error
- func DumpAstTypes(m *MtailServer) error
- func DumpBytecode(m *MtailServer) error
- func LogPathPatterns(patterns ...string) func(*MtailServer) error
- func OmitMetricSource(m *MtailServer) error
- func OmitProgLabel(m *MtailServer) error
- func OneShot(m *MtailServer) error
- func OverrideLocation(loc *time.Location) func(*MtailServer) error
- func ProgramPath(path string) func(*MtailServer) error
- func SyslogUseCurrentYear(m *MtailServer) error
- type MtailServer
- func (m *MtailServer) Close() error
- func (m *MtailServer) Run() error
- func (m *MtailServer) Serve() error
- func (m *MtailServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (m *MtailServer) SetOption(options ...func(*MtailServer) error) error
- func (m *MtailServer) StartTailing() error
- func (m *MtailServer) WaitForShutdown()
- func (m *MtailServer) WriteMetrics(w io.Writer) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindAddress ¶
func BindAddress(address, port string) func(*MtailServer) error
BindAddress sets the HTTP server address in MtailServer.
func BuildInfo ¶
func BuildInfo(info string) func(*MtailServer) error
BuildInfo sets the mtail program build information in the MtailServer.
func CompileOnly ¶
func CompileOnly(m *MtailServer) error
CompileOnly sets compile-only mode in the MtailServer.
func DumpAst ¶
func DumpAst(m *MtailServer) error
DumpAst instructs the MtailServer's compiler to print the AST after parsing.
func DumpAstTypes ¶
func DumpAstTypes(m *MtailServer) error
DumpAstTypes instructs the MtailServer's copmiler to print the AST after type checking.
func DumpBytecode ¶
func DumpBytecode(m *MtailServer) error
DumpBytecode instructs the MtailServer's compiuler to print the program bytecode after code generation.
func LogPathPatterns ¶
func LogPathPatterns(patterns ...string) func(*MtailServer) error
LogPathPatterns sets the patterns to find log paths in the MtailServer.
func OmitMetricSource ¶
func OmitMetricSource(m *MtailServer) error
OmitMetricSource sets the MtailServer to not link created metrics to their source program.
func OmitProgLabel ¶
func OmitProgLabel(m *MtailServer) error
OmitProgLabel sets the MtailServer to not put the program name as a label in exported metrics.
func OverrideLocation ¶
func OverrideLocation(loc *time.Location) func(*MtailServer) error
OverrideLocation sets the timezone location for log timestamps without any such information.
func ProgramPath ¶
func ProgramPath(path string) func(*MtailServer) error
ProgramPath sets the path to find mtail programs in the MtailServer.
func SyslogUseCurrentYear ¶
func SyslogUseCurrentYear(m *MtailServer) error
SyslogUseCurrentYear instructs the MtailServer to use the current year for year-less log timestamp during parsing.
Types ¶
type MtailServer ¶
type MtailServer struct {
// contains filtered or unexported fields
}
MtailServer contains the state of the main program object.
func New ¶
func New(store *metrics.Store, w watcher.Watcher, fs afero.Fs, options ...func(*MtailServer) error) (*MtailServer, error)
New creates a 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) 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() error
Serve begins the webserver and awaits a shutdown instruction.
func (*MtailServer) ServeHTTP ¶
func (m *MtailServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*MtailServer) SetOption ¶
func (m *MtailServer) SetOption(options ...func(*MtailServer) error) error
SetOption takes one or more option functions and applies them in order to MtailServer.
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.