Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNoStateFile = errors.New("state file doesn't exist")
ErrNoStateFile indicates that state file doesn't exist. Most likely this happens because server is being processed first time
Functions ¶
func SaveState ¶
func SaveState(conn ConnectionInfo, stats State) error
SaveState saves State for given server
Types ¶
type ConnectionInfo ¶
ConnectionInfo represents information about connection to server with nginx logs
func (ConnectionInfo) ServerName ¶
func (conn ConnectionInfo) ServerName() string
ServerName returns server name as Address:Port
func (ConnectionInfo) String ¶
func (conn ConnectionInfo) String() string
type LogRecord ¶
type LogRecord struct {
IPAddress string
Time time.Time
Duration float64
Verb string
Path string
HTTPStatusCode int
Size int
Domain string
Referrer string
UserAgent string
}
LogRecord represents a line of nginx log file
type State ¶
type State struct {
// NotZippedLogFile stores the name of only log file that was not zipped yet except access.log.
// If this name changes it means that nginx has started new log file and archived access.log that we were reading last time
RotatedLog FileInfo
// BytesRead stores Number of bytes that were already read from access.log
BytesRead int
}
State store information about state from previous connection
func GetState ¶
func GetState(conn ConnectionInfo) (State, error)
GetState returns State object for given server
Click to show internal directories.
Click to hide internal directories.