proxy

package
v0.0.0-...-f111e62 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2017 License: MIT, MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (

	// or the listener type/name for this frontend connection
	ListenerType = "mysql"
)

Functions

func BuildSimpleSelectResult

func BuildSimpleSelectResult(value interface{}, name []byte, asName []byte) (*mysql.Resultset, error)

func BuildSimpleShowResultset

func BuildSimpleShowResultset(values []interface{}, name string) (*mysql.Resultset, error)

func NewHandlerSharded

func NewHandlerSharded(conf *models.Config) (models.Listener, error)

Types

type Conn

type Conn struct {
	sync.Mutex

	Status uint16
	// contains filtered or unexported fields
}

Conn serves as a Frontend (inbound listener) on mysql protocol

--> frontend --> handler --> backend

func (*Conn) Close

func (c *Conn) Close() error

func (*Conn) ConnId

func (c *Conn) ConnId() uint32

func (*Conn) HandleShowProxyConfig

func (c *Conn) HandleShowProxyConfig() (*mysql.Resultset, error)

func (*Conn) Handshake

func (c *Conn) Handshake() error

func (*Conn) NewEmptyResultsetOLD

func (c *Conn) NewEmptyResultsetOLD(stmt *sqlparser.Select) *mysql.Resultset

func (*Conn) Run

func (c *Conn) Run()

Run is a blocking command PER client connection it is called AFTER Handshake()

->   listener.go:onConn()
          conn.go:onConn()
                <- handshake ->
                conn.go:Run()
                     request/reply

func (*Conn) UseDb

func (c *Conn) UseDb(db string) error

func (*Conn) User

func (c *Conn) User() string

func (*Conn) WriteEOF

func (c *Conn) WriteEOF(status uint16) error

func (*Conn) WriteError

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

func (*Conn) WriteFieldList

func (c *Conn) WriteFieldList(status uint16, fs []*mysql.Field) error

func (*Conn) WriteHandlerResult

func (c *Conn) WriteHandlerResult(status uint16, r *mysql.Resultset) error

func (*Conn) WriteOK

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

func (*Conn) WritePacket

func (c *Conn) WritePacket(data []byte) error

func (*Conn) WriteResult

func (c *Conn) WriteResult(r models.Result) error

func (*Conn) WriteResultset

func (c *Conn) WriteResultset(status uint16, r *mysql.Resultset) error

type HandlerSharded

type HandlerSharded struct {
	*HandlerShardedShared
	// contains filtered or unexported fields
}

Handle request splitting, a single connection session not threadsafe, not shared

func (*HandlerSharded) Close

func (m *HandlerSharded) Close() error

func (*HandlerSharded) Handle

func (m *HandlerSharded) Handle(writer models.ResultWriter, req *models.Request) error

func (*HandlerSharded) Init

func (*HandlerSharded) Run

func (m *HandlerSharded) Run(stop chan bool) error

func (*HandlerSharded) SchemaUse

func (m *HandlerSharded) SchemaUse(db string) *schema.Schema

func (*HandlerSharded) WriteOK

func (m *HandlerSharded) WriteOK(r *mysql.Result) error

type HandlerShardedShared

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

Handle request splitting, a single connection session not threadsafe, not shared

func (*HandlerShardedShared) Open

func (m *HandlerShardedShared) Open(connI interface{}) models.StatementHandler

type Node

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

Node describes a backend server endpoint and is responsible for creating connections to these backends as well as monitoring health of them

func (*Node) String

func (n *Node) String() string

type SchemaSharded

type SchemaSharded struct {
	*schema.SchemaSource
	// contains filtered or unexported fields
}

Schema is the schema for a named database, shared across multiple nodes

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