mygl

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2015 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdBinlogDump    = "Binlog Dump"
	CmdChangeUser    = "Change user"
	CmdCloseStmt     = "Close stmt"
	CmdConnect       = "Connect"
	CmdConnectOut    = "Connect Out"
	CmdCreateDB      = "Create DB"
	CmdDaemon        = "Daemon"
	CmdDebug         = "Debug"
	CmdDelayedInsert = "Delayed insert"
	CmdDropDB        = "Drop DB"
	CmdError         = "Error"
	CmdExecute       = "Execute"
	CmdFetch         = "Fetch"
	CmdFieldList     = "Field List"
	CmdInitDB        = "Init DB"
	CmdKill          = "Kill"
	CmdLongData      = "Long Data"
	CmdPing          = "Ping"
	CmdPrepare       = "Prepare"
	CmdProcesslist   = "Processlist"
	CmdQuery         = "Query"
	CmdQuit          = "Quit"
	CmdRefresh       = "Refresh"
	CmdRegisterSlave = "Register Slave"
	CmdResetStmt     = "Reset stmt"
	CmdSetOption     = "Set option"
	CmdShutdown      = "Shutdown"
	CmdSleep         = "Sleep"
	CmdStatistics    = "Statistics"
	CmdTableDump     = "Table Dump"
	CmdTime          = "Time"
)

Common commands from the query log.

View Source
const TimeFormat = "060102 15:04:05"

AtFormat is the format of the time column

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Time              time.Time
	ID                int
	Command, Argument string
}

Entry is an entry in the MySQL general log.

func (Entry) String

func (c Entry) String() string

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader reads Command instances from a reader.

func NewReader

func NewReader(r io.Reader) *Reader

NewReader returns a new Reader, wrapping the passed reader in a bufio.Reader if the existing one doesn't provide the Peek function.

func (*Reader) ReadEntry

func (r *Reader) ReadEntry() (*Entry, error)

ReadEntry reads an entry from a general log, skipping headers if required.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL