control

package
v0.0.0-...-70491fa Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dummy bool

Functions

func Flush

func Flush(w net.Conn) (err error)

func HandleCommand

func HandleCommand(c *C.Command)

func LockHandleCommand

func LockHandleCommand()

func Send

func Send(w net.Conn, b []byte) (err error)

func SendCommand

func SendCommand(w net.Conn, command string, args ...interface{}) error

func UnlockHandleCommand

func UnlockHandleCommand()

Types

type CustomConfigT

type CustomConfigT struct {
	ProtoName    string
	TransferName string
	ViewName     string
}

type DBConfigT

type DBConfigT struct {
	DBFile                 string
	DBSaveFrame            string
	DBReadOnly             bool
	DBAOF                  bool
	DBAsync                bool
	DBAsyncQueueSize       int
	DBCopyOnWriteQueueSize int
}

type DBManager

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

func GetDBManager

func GetDBManager() *DBManager

func (*DBManager) BgSave

func (this *DBManager) BgSave() (err error)

----------------------- BGSave ------------------------

func (*DBManager) Init

func (this *DBManager) Init() (err error)

func (*DBManager) IsSaving

func (this *DBManager) IsSaving() bool

func (*DBManager) OnPreCall

func (this *DBManager) OnPreCall(key string)

--------------------- common -----------------------

func (*DBManager) Save

func (this *DBManager) Save() (err error)

func (*DBManager) SetNoSaving

func (this *DBManager) SetNoSaving()

func (*DBManager) SetSaving

func (this *DBManager) SetSaving() bool

type DBMarshal

type DBMarshal struct {
}

func GetDBMarshal

func GetDBMarshal() *DBMarshal

type DebugConfigT

type DebugConfigT struct {
	IsProf      bool
	ProfAddress string
	HeapProfile string
}

type KeyDBData

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

type RuntimeConfigT

type RuntimeConfigT struct {
	Listen string
	Procs  int
}

type ServerConfig

type ServerConfig struct {
	DebugConfig   DebugConfigT
	CustomConfig  CustomConfigT
	RuntimeConfig RuntimeConfigT
	SyncConfig    SyncConfigT
	DBConfig      DBConfigT

	LogDir string
	// contains filtered or unexported fields
}

func GetServerConfig

func GetServerConfig() *ServerConfig

func (*ServerConfig) DumpConfig

func (this *ServerConfig) DumpConfig() string

func (*ServerConfig) InitFlags

func (this *ServerConfig) InitFlags() error

func (*ServerConfig) IsDump

func (this *ServerConfig) IsDump() bool

type SlaverClient

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

func NewSlaverClient

func NewSlaverClient() *SlaverClient

func (*SlaverClient) Close

func (this *SlaverClient) Close()

func (*SlaverClient) Dial

func (this *SlaverClient) Dial(addr string) (err error)

func (*SlaverClient) StartSync

func (this *SlaverClient) StartSync() error

type SlaverEntry

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

func (*SlaverEntry) IsForeachEnd

func (this *SlaverEntry) IsForeachEnd() bool

func (*SlaverEntry) Ping

func (this *SlaverEntry) Ping() error

func (*SlaverEntry) Process

func (this *SlaverEntry) Process() (numDone int, err error)

func (*SlaverEntry) PushCommand

func (this *SlaverEntry) PushCommand(c *C.Command)

func (*SlaverEntry) SetForeachEnd

func (this *SlaverEntry) SetForeachEnd()

type SyncCommand

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

type SyncConfigT

type SyncConfigT struct {
	SyncQueueSize int
}

type SyncMgr

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

主从同步管理器

func GetSyncMgr

func GetSyncMgr() *SyncMgr

func (*SyncMgr) DecTotalSyncing

func (this *SyncMgr) DecTotalSyncing()

func (*SyncMgr) GetSyncStatus

func (this *SyncMgr) GetSyncStatus() SyncStatus

func (*SyncMgr) IncTotalSyncing

func (this *SyncMgr) IncTotalSyncing()

func (*SyncMgr) Info

func (this *SyncMgr) Info() (s string)

func (*SyncMgr) IsMaster

func (this *SyncMgr) IsMaster() bool

func (*SyncMgr) IsReadOnly

func (this *SyncMgr) IsReadOnly() bool

func (*SyncMgr) IsSlaver

func (this *SyncMgr) IsSlaver() bool

func (*SyncMgr) IsSlaverTotalSyncing

func (this *SyncMgr) IsSlaverTotalSyncing() bool

当前是slaver, 并且处于全量同步中

func (*SyncMgr) IsTotalSyncing

func (this *SyncMgr) IsTotalSyncing() bool

是否有全量同步中的slaver

func (*SyncMgr) OnCall

func (this *SyncMgr) OnCall(c *C.Command)

func (*SyncMgr) OnFlushAll

func (this *SyncMgr) OnFlushAll()

func (*SyncMgr) OnMonitor

func (this *SyncMgr) OnMonitor(monitor net.Conn) error

func (*SyncMgr) OnPong

func (this *SyncMgr) OnPong(slaver net.Conn)

func (*SyncMgr) OnSync

func (this *SyncMgr) OnSync(uuid string, seq int64, slaver net.Conn) error

---------------------------------------------------------------- master

func (*SyncMgr) OnSyncKeyEnd

func (this *SyncMgr) OnSyncKeyEnd()

func (*SyncMgr) ResetSync

func (this *SyncMgr) ResetSync()

func (*SyncMgr) SetSyncStatus

func (this *SyncMgr) SetSyncStatus(s SyncStatus)

func (*SyncMgr) Slaveof

func (this *SyncMgr) Slaveof(host string, port string) error

---------------------------------------------------------------- slaver

func (*SyncMgr) SlaverStatus

func (this *SyncMgr) SlaverStatus() SyncStatus

func (*SyncMgr) StartProcessSlavers

func (this *SyncMgr) StartProcessSlavers()

type SyncStatus

type SyncStatus int

Jump to

Keyboard shortcuts

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