proxy

package
v0.0.0-...-4a551d5 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Master = "master"
	Slave  = "slave"
)

Variables

View Source
var DEFAULT_CAPABILITY uint32 = CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG |
	CLIENT_CONNECT_WITH_DB | CLIENT_PROTOCOL_41 |
	CLIENT_TRANSACTIONS | CLIENT_SECURE_CONNECTION

Functions

This section is empty.

Types

type Conn

type Conn struct {
	sync.Mutex
	// contains filtered or unexported fields
}

client <-> proxy

func NewConn

func NewConn(co net.Conn, handler ConnHandlerInterface) *Conn

func (*Conn) BuildEmptyResultSet

func (c *Conn) BuildEmptyResultSet() (*Resultset, error)

func (*Conn) BuildResultset

func (c *Conn) BuildResultset(names []string, values [][]interface{}) (*Resultset, error)

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) GetStatus

func (c *Conn) GetStatus() (status uint16)

func (*Conn) Handshake

func (c *Conn) Handshake() error

func (*Conn) Run

func (c *Conn) Run()

func (*Conn) WriteEmptyResultSet

func (c *Conn) WriteEmptyResultSet() error

func (*Conn) WriteError

func (c *Conn) WriteError(e error) error

func (*Conn) WriteOK

func (c *Conn) WriteOK(r *Result) error

func (*Conn) WriteOKWithData

func (c *Conn) WriteOKWithData(insertId, affectedRows uint64) error

func (*Conn) WriteResultSet

func (c *Conn) WriteResultSet(status uint16, r *Resultset) error

func (*Conn) WriteResultSetWithData

func (c *Conn) WriteResultSetWithData(name []string, values [][]interface{}) error

type ConnHandlerInterface

type ConnHandlerInterface interface {
	DispatchHandler(data any, err error) error
	PreDispatchHandler(data string) (allowed bool)
	InitDb() (*sql.DB, error)
	CheckAuthFunc(user string) (bool, string)
	RecordAuthFunc(allowed bool)
}

type Node

type Node struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func (*Node) String

func (n *Node) String() string

type Schema

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

type Server

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

func NewServer

func NewServer(cfg *config.Config) (*Server, error)

func (*Server) Close

func (s *Server) Close()

func (*Server) DownMaster

func (s *Server) DownMaster(node string) error

func (*Server) DownSlave

func (s *Server) DownSlave(node string) error

func (*Server) Run

func (s *Server) Run() error

func (*Server) UpMaster

func (s *Server) UpMaster(node string, addr string) error

func (*Server) UpSlave

func (s *Server) UpSlave(node string, addr string) error

type Stmt

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

func (*Stmt) ResetParams

func (s *Stmt) ResetParams()

Jump to

Keyboard shortcuts

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