Documentation
¶
Index ¶
- func CopyDebug(prefix string, dst io.Writer, src io.Reader) (int64, error)
- func DumpResult(res *mysql.Result, err error)
- func PrintCapability(capability uint32)
- type ClientSess
- type ConfigProvider
- type Conn
- type DebugConn
- func (d *DebugConn) Close() error
- func (d *DebugConn) LocalAddr() net.Addr
- func (d *DebugConn) Read(b []byte) (int, error)
- func (d *DebugConn) RemoteAddr() net.Addr
- func (d *DebugConn) SetDeadline(t time.Time) error
- func (d *DebugConn) SetReadDeadline(t time.Time) error
- func (d *DebugConn) SetWriteDeadline(t time.Time) error
- func (d *DebugConn) Write(b []byte) (int, error)
- type DebugWriter
- type LogWriter
- type Provider
- type ProxyCfg
- type ProxySrv
- type ProxyUser
- type SendTask
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyDebug ¶ added in v0.0.5
CopyDebug は io.Copy 相当のヘルパー。 dst 側に DebugWriter をかませてプレフィックス付きダンプを行う。
func DumpResult ¶ added in v0.0.5
func PrintCapability ¶ added in v0.0.5
func PrintCapability(capability uint32)
Types ¶
type ClientSess ¶
type ClientSess struct {
ClientMysql *server.Conn
TargetMysql *client.Conn
ProxySrv *ProxySrv
TargetNet string
TargetAddr string
TargetUser string
TargetPassword string
TargetDB string
}
func (*ClientSess) ConnectToMySQL ¶
func (c *ClientSess) ConnectToMySQL(ctx context.Context) error
ClntSess methods ConnectToMySQL connect to mysql target server
func (*ClientSess) Proxy ¶
func (c *ClientSess) Proxy(ctx context.Context)
type ConfigProvider ¶
type ConfigProvider struct {
// contains filtered or unexported fields
}
implements a in memory credential provider
func NewConfigProvider ¶
func NewConfigProvider(m userManager) *ConfigProvider
func (*ConfigProvider) CheckUsername ¶
func (m *ConfigProvider) CheckUsername(username string) (bool, error)
func (*ConfigProvider) GetCredential ¶
func (m *ConfigProvider) GetCredential(username string) (password string, found bool, err error)
type DebugConn ¶ added in v0.0.5
DebugConn は書き込みデバッグ用の薄いラッパ。
func (*DebugConn) RemoteAddr ¶ added in v0.0.5
func (*DebugConn) SetReadDeadline ¶ added in v0.0.5
func (*DebugConn) SetWriteDeadline ¶ added in v0.0.5
type DebugWriter ¶ added in v0.0.5
type LogWriter ¶
type LogWriter interface {
PushToLogChannel(ctx context.Context, sp *sendpacket.SendPacket) error
PutSendPacket(b *sendpacket.SendPacket)
GetSendPacket() *sendpacket.SendPacket
CloseChannel()
}
type Provider ¶
type Provider ConfigProvider
type ProxyCfg ¶
type ProxyCfg struct {
ProxyListenAddr string `default:":3307"` // "localhost:3307"
ProxyListentNet string `default:"tcp"` // tcp or unix
ConTimeout time.Duration `default:"300s"`
LogFileName string `default:"mysql-audit.%Y%m%d%H.log.gz"`
RotateTime time.Duration `default:"1h"`
AdminUser string `default:"admin"`
Debug bool `default:"false"`
}
Click to show internal directories.
Click to hide internal directories.