server

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2015 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClientTypeNormal = iota
	ClientTypeMaster
	ClientTypeSlave
)

Variables

This section is empty.

Functions

func BackupDirName

func BackupDirName(conf *config.Config) string

func BinLogDirName

func BinLogDirName(conf *config.Config) string

func ConfigDirName

func ConfigDirName(conf *config.Config) string

func NewMaster

func NewMaster(slaveAddr string, lastSeq uint64, migration bool, unitId uint16,
	cli *Client, bin *binlog.BinLog) *master

func NewSlave

func NewSlave(reqChan *RequestChan, bin *binlog.BinLog,
	mc *config.MasterConfig, adminPwd string) *slave

func TableDirName

func TableDirName(conf *config.Config) string

Types

type Client

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

func NewClient

func NewClient(conn net.Conn, authEnabled bool) *Client

func (*Client) AddResp

func (c *Client) AddResp(pkg []byte)

func (*Client) ClientType

func (c *Client) ClientType() uint32

func (*Client) Close

func (c *Client) Close()

func (*Client) GoRecvRequest

func (c *Client) GoRecvRequest(ch *RequestChan, slv *slave)

func (*Client) GoSendResponse

func (c *Client) GoSendResponse()

func (*Client) IsAuth

func (c *Client) IsAuth(dbId uint8) bool

Check whether dbId is authencated. If dbId is 255, it means admin privilege.

func (*Client) IsClosed

func (c *Client) IsClosed() bool

func (*Client) LocalAddr

func (c *Client) LocalAddr() net.Addr

func (*Client) RemoteAddr

func (c *Client) RemoteAddr() net.Addr

func (*Client) SetAuth

func (c *Client) SetAuth(dbId uint8)

func (*Client) SetClientType

func (c *Client) SetClientType(cliType uint32)

type Request

type Request struct {
	Cli *Client
	Slv *slave
	store.PkgArgs
}

type RequestChan

type RequestChan struct {
	WriteReqChan chan *Request
	ReadReqChan  chan *Request
	SyncReqChan  chan *Request
	DumpReqChan  chan *Request
	CtrlReqChan  chan *Request
}

type Server

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

func NewServer

func NewServer(conf *config.Config) *Server

func (*Server) Close

func (srv *Server) Close()

Stop server and exit

func (*Server) IsClosed

func (srv *Server) IsClosed() bool

func (*Server) Start

func (srv *Server) Start()

Jump to

Keyboard shortcuts

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