Documentation ¶
Index ¶
- Constants
- type Monitor
- type MonitorOutput
- type Opt
- func InFunc(msg string) Opt
- func IsCreate() Opt
- func IsDelete() Opt
- func IsFind() Opt
- func IsPublish() Opt
- func IsPublished() Opt
- func IsUpdate() Opt
- func KeyValues(in map[string]interface{}) Opt
- func Note(args ...interface{}) Opt
- func TargetCollection() Opt
- func TargetItem() Opt
- func TargetLink() Opt
- func TargetResource() Opt
- func TargetVersion() Opt
- func Time(t int64) Opt
- type Settings
- type WebserverConfig
Constants ¶
View Source
const ( // The driver names that we accept DriverLogfile = "logfile" DriverElastic = "elastic" DriverStdout = "stdout" )
View Source
const (
// We'll only hold this many docs in memory (they're still written to logs ASAP)
MonitorMaxDocsHeld = 50
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Parent struct that handles writing to all child MonitorOutput(s)
func NewMonitor ¶
func NewMonitor(outs ...MonitorOutput) (*Monitor, error)
Create and return a new Monitor
Kicks off child routine to write new log messages
func (*Monitor) Log ¶
Write given doc to all output(s) Since this is intended for logging, no errors due to being unable to log should cause failures.
func (*Monitor) Start ¶
func (m *Monitor) Start(settings *WebserverConfig) error
Kick off the sub routines that run int the Monitor
- routines to write to log(s)
- routine to reply to http requests
type MonitorOutput ¶
type MonitorOutput interface { Log(*event) Close() }
Represents somewhere to write stats / log documents to
func Connect ¶
func Connect(settings *Settings) (MonitorOutput, error)
Return a connect function for the given settings, or err if it can't be found
type Opt ¶
type Opt func(*event)
func IsPublished ¶
func IsPublished() Opt
func TargetCollection ¶
func TargetCollection() Opt
func TargetItem ¶
func TargetItem() Opt
Set what kind of obj we're targeting (trying to find, create, delete etc)
func TargetLink ¶
func TargetLink() Opt
func TargetResource ¶
func TargetResource() Opt
func TargetVersion ¶
func TargetVersion() Opt
type Settings ¶
type Settings struct { // What will be used to write the log Driver string // What host / location the log should go to Location string // Where in the given location the log should go Target string }
Settings for some form of logging output
type WebserverConfig ¶
Config for monitor's webserver
Click to show internal directories.
Click to hide internal directories.