Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 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"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.