server

package
v0.0.0-...-e4d8650 Latest Latest
Warning

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

Go to latest
Published: May 1, 2024 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STATE_INIT = iota
	STATE_LEADER
	STATE_FOLLOWER
	STATE_SYNC
	STATE_CONFIG
	STATE_VOTE
	STATE_CLOSE
)
View Source
const (
	STREAM_TYPE_NORMAL  uint8 = 0
	STREAM_TYPE_AOF     uint8 = 1
	STREAM_TYPE_ARBITER uint8 = 2
)
View Source
const AOF_FLAG_CONTAINS_DATA = 0x2000
View Source
const AOF_FLAG_EXPRIED = 0x0004
View Source
const AOF_FLAG_REQUIRE_ACKED = 0x1000
View Source
const AOF_FLAG_REWRITED = 0x0001
View Source
const AOF_FLAG_TIMEOUTED = 0x0002
View Source
const AOF_FLAG_UPDATED = 0x0008
View Source
const AOF_LOCK_TYPE_ACK_ACKED = 4
View Source
const AOF_LOCK_TYPE_ACK_FILE = 3
View Source
const AOF_LOCK_TYPE_CONSISTENCY_BARRIER = 5
View Source
const AOF_LOCK_TYPE_FILE = 0
View Source
const AOF_LOCK_TYPE_LOAD = 1
View Source
const AOF_LOCK_TYPE_REPLAY = 2
View Source
const ARBITER_MEMBER_STATUS_CONNECTED = 3
View Source
const ARBITER_MEMBER_STATUS_OFFLINE = 4
View Source
const ARBITER_MEMBER_STATUS_ONLINE = 5
View Source
const ARBITER_MEMBER_STATUS_UNINIT = 2
View Source
const ARBITER_MEMBER_STATUS_UNOPEN = 1
View Source
const ARBITER_ROLE_ARBITER = 3
View Source
const ARBITER_ROLE_FOLLOWER = 2
View Source
const ARBITER_ROLE_LEADER = 1
View Source
const ARBITER_ROLE_UNKNOWN = 0
View Source
const EXPRIED_LOCKS_QUEUE_INIT_SIZE = 4096
View Source
const EXPRIED_QUEUE_LENGTH int64 = 0x10
View Source
const EXPRIED_QUEUE_LENGTH_MASK int64 = 0x0f
View Source
const EXPRIED_QUEUE_MAX_WAIT uint8 = 0x08
View Source
const EXPRIED_WAIT_LEADER_MAX_TIME int64 = 300
View Source
const FREE_COMMAND_MAX_SIZE = 256
View Source
const FREE_COMMAND_QUEUE_INIT_SIZE = 256
View Source
const FREE_LOCK_QUEUE_INIT_SIZE = 4096
View Source
const FREE_LONG_WAIT_QUEUE_INIT_SIZE = 8096
View Source
const FREE_MILLISECOND_WAIT_QUEUE_INIT_SIZE = 8096
View Source
const LONG_EXPRIED_LOCKS_INIT_COUNT = 256
View Source
const LONG_LOCKS_QUEUE_INIT_SIZE = 1024
View Source
const LONG_TIMEOUT_LOCKS_INIT_COUNT = 256
View Source
const MANAGER_MAX_GLOCKS_INIT_SIZE = 262144
View Source
const MILLISECOND_LOCKS_QUEUE_INIT_SIZE = 1024
View Source
const MILLISECOND_QUEUE_LENGTH = 3000
View Source
const QUEUE_MAX_MALLOC_SIZE = 0x3fffff
View Source
const REPLICATION_ACK_DB_INIT_SIZE = 256
View Source
const REPLICATION_MAX_FREE_ACK_LOCK_QUEUE_SIZE = 4096
View Source
const STREAMS_INIT_COUNT = 256
View Source
const TIMEOUT_LOCKS_QUEUE_INIT_SIZE = 4096
View Source
const TIMEOUT_QUEUE_LENGTH int64 = 0x10
View Source
const TIMEOUT_QUEUE_LENGTH_MASK int64 = 0x0f
View Source
const TIMEOUT_QUEUE_MAX_WAIT uint8 = 0x08
View Source
const VERSION = "2.1.0"

Variables

View Source
var AGAIN = errors.New("AGAIN")
View Source
var ProposalRejectError = errors.New("Proposal Reject")
View Source
var ROLE_NAMES = []string{"unknown", "leader", "follower", "arbiter"}
View Source
var STATE_NAMES = []string{"initing", "leader", "follower", "syncing", "config", "vote", "close"}

Functions

func FormatAofId

func FormatAofId(aofId [16]byte) string

func InitLogger

func InitLogger(config *ServerConfig) (logging.Logger, error)

func ParseAofId

func ParseAofId(aofIdString string) ([16]byte, error)

func SetConfig

func SetConfig(config *ServerConfig)

Types

type Admin

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

func NewAdmin

func NewAdmin() *Admin

func (*Admin) Close

func (self *Admin) Close()

func (*Admin) GetHandlers

func (self *Admin) GetHandlers() map[string]TextServerProtocolCommandHandler

type Aof

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

func NewAof

func NewAof() *Aof

func (*Aof) AppendLock

func (self *Aof) AppendLock(aofLock *AofLock) bool

func (*Aof) Close

func (self *Aof) Close()

func (*Aof) CloseAofChannel

func (self *Aof) CloseAofChannel(aofChannel *AofChannel) *AofChannel

func (*Aof) ExecuteConsistencyBarrierCommand

func (self *Aof) ExecuteConsistencyBarrierCommand(commandType uint8) bool

func (*Aof) FindAofFiles

func (self *Aof) FindAofFiles() ([]string, string, error)

func (*Aof) Flush

func (self *Aof) Flush()

func (*Aof) FlushWithLocked

func (self *Aof) FlushWithLocked()

func (*Aof) GetCurrentAofID

func (self *Aof) GetCurrentAofID() [16]byte

func (*Aof) Init

func (self *Aof) Init() ([16]byte, error)

func (*Aof) Load

func (self *Aof) Load() error

func (*Aof) LoadAndInit

func (self *Aof) LoadAndInit() error

func (*Aof) LoadAofFile

func (self *Aof) LoadAofFile(filename string, lock *AofLock, expriedTime int64, iterFunc func(string, *AofFile, *AofLock, bool) (bool, error)) error

func (*Aof) LoadAofFiles

func (self *Aof) LoadAofFiles(filenames []string, expriedTime int64, iterFunc func(string, *AofFile, *AofLock, bool) (bool, error)) error

func (*Aof) LoadFileMaxAofLock

func (self *Aof) LoadFileMaxAofLock(filename string) (*AofLock, error)

func (*Aof) LoadLock

func (self *Aof) LoadLock(aofLock *AofLock) error

func (*Aof) LoadMaxAofId

func (self *Aof) LoadMaxAofId() ([16]byte, error)

func (*Aof) NewAofChannel

func (self *Aof) NewAofChannel(lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *AofChannel

func (*Aof) OpenAofFile

func (self *Aof) OpenAofFile(aofIndex uint32) (*AofFile, error)

func (*Aof) PushLock

func (self *Aof) PushLock(glockIndex uint16, aofLock *AofLock) error

func (*Aof) RemoveAofChannel

func (self *Aof) RemoveAofChannel(aofChannel *AofChannel) *AofChannel

func (*Aof) ReplayLock

func (self *Aof) ReplayLock(aofLock *AofLock) error

func (*Aof) Reset

func (self *Aof) Reset(aofFileIndex uint32, aofFileOffset uint32) error

func (*Aof) RewriteAofFile

func (self *Aof) RewriteAofFile(startRewite bool) error

func (*Aof) WaitFlushAofChannel

func (self *Aof) WaitFlushAofChannel() error

func (*Aof) WaitRewriteAofFiles

func (self *Aof) WaitRewriteAofFiles() error

type AofChannel

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

func NewAofChannel

func NewAofChannel(aof *Aof, lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *AofChannel

func (*AofChannel) Acked

func (self *AofChannel) Acked(commandResult *protocol.LockResultCommand) error

func (*AofChannel) AofAcked

func (self *AofChannel) AofAcked(buf []byte, succed bool) error

func (*AofChannel) Handle

func (self *AofChannel) Handle(aofLock *AofLock)

func (*AofChannel) HandleAcked

func (self *AofChannel) HandleAcked(aofLock *AofLock)

func (*AofChannel) HandleAofAcked

func (self *AofChannel) HandleAofAcked(aofLock *AofLock)

func (*AofChannel) HandleConsistencyBarrierCommand

func (self *AofChannel) HandleConsistencyBarrierCommand(aofLock *AofLock)

func (*AofChannel) HandleLoad

func (self *AofChannel) HandleLoad(aofLock *AofLock)

func (*AofChannel) HandleLock

func (self *AofChannel) HandleLock(aofLock *AofLock)

func (*AofChannel) HandleReplay

func (self *AofChannel) HandleReplay(aofLock *AofLock)

func (*AofChannel) Load

func (self *AofChannel) Load(fromAofLock *AofLock) error

func (*AofChannel) Push

func (self *AofChannel) Push(dbId uint8, lock *Lock, commandType uint8, lockCommand *protocol.LockCommand, unLockCommand *protocol.LockCommand, aofFlag uint16, lockData []byte) error

func (*AofChannel) Replay

func (self *AofChannel) Replay(fromAofLock *AofLock) error

func (*AofChannel) Run

func (self *AofChannel) Run()

type AofFile

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

func NewAofFile

func NewAofFile(aof *Aof, filename string, mode int, bufSize int) *AofFile

func (*AofFile) AppendLock

func (self *AofFile) AppendLock(lock *AofLock) error

func (*AofFile) Close

func (self *AofFile) Close() error

func (*AofFile) Flush

func (self *AofFile) Flush() error

func (*AofFile) GetSize

func (self *AofFile) GetSize() int

func (*AofFile) Open

func (self *AofFile) Open() error

func (*AofFile) ReadHeader

func (self *AofFile) ReadHeader() error

func (*AofFile) ReadLock

func (self *AofFile) ReadLock(lock *AofLock) error

func (*AofFile) ReadLockData

func (self *AofFile) ReadLockData(lock *AofLock) error

func (*AofFile) ReadTail

func (self *AofFile) ReadTail(lock *AofLock) error

func (*AofFile) Sync

func (self *AofFile) Sync() error

func (*AofFile) WriteHeader

func (self *AofFile) WriteHeader() error

func (*AofFile) WriteLock

func (self *AofFile) WriteLock(lock *AofLock) error

func (*AofFile) WriteLockData

func (self *AofFile) WriteLockData(lock *AofLock) error

type AofLock

type AofLock struct {
	HandleType  uint8
	CommandType uint8
	AofIndex    uint32
	AofOffset   uint32
	CommandTime uint64
	Flag        uint8
	DbId        uint8
	LockId      [16]byte
	LockKey     [16]byte
	AofFlag     uint16
	StartTime   uint16
	ExpriedFlag uint16
	ExpriedTime uint16
	Count       uint16
	Rcount      uint8
	Result      uint8
	Lcount      uint16
	Lrcount     uint8
	// contains filtered or unexported fields
}

func NewAofLock

func NewAofLock() *AofLock

func (*AofLock) Decode

func (self *AofLock) Decode() error

func (*AofLock) Encode

func (self *AofLock) Encode() error

func (*AofLock) GetAofId

func (self *AofLock) GetAofId() [16]byte

func (*AofLock) GetBuf

func (self *AofLock) GetBuf() []byte

func (*AofLock) SetAofId

func (self *AofLock) SetAofId(buf [16]byte)

func (*AofLock) UpdateAofId

func (self *AofLock) UpdateAofId(aofIndex uint32, aofOffset uint32) error

type AofLockQueue

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

type ArbiterClient

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

func NewArbiterClient

func NewArbiterClient(member *ArbiterMember) *ArbiterClient

func (*ArbiterClient) Close

func (self *ArbiterClient) Close() error

func (*ArbiterClient) Open

func (self *ArbiterClient) Open(addr string) error

func (*ArbiterClient) Request

func (self *ArbiterClient) Request(command *protocol.CallCommand) (*protocol.CallResultCommand, error)

func (*ArbiterClient) Run

func (self *ArbiterClient) Run()

func (*ArbiterClient) WakeupRetryConnect

func (self *ArbiterClient) WakeupRetryConnect() error

type ArbiterManager

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

func NewArbiterManager

func NewArbiterManager(slock *SLock, name string) *ArbiterManager

func (*ArbiterManager) AddMember

func (self *ArbiterManager) AddMember(host string, weight uint32, arbiter uint32) error

func (*ArbiterManager) Close

func (self *ArbiterManager) Close() error

func (*ArbiterManager) CompareAofId

func (self *ArbiterManager) CompareAofId(a [16]byte, b [16]byte) int

func (*ArbiterManager) Config

func (self *ArbiterManager) Config(host string, weight uint32, arbiter uint32) error

func (*ArbiterManager) DecodeAofId

func (self *ArbiterManager) DecodeAofId(aofIdString string) [16]byte

func (*ArbiterManager) DoAnnouncement

func (self *ArbiterManager) DoAnnouncement()

func (*ArbiterManager) EncodeAofId

func (self *ArbiterManager) EncodeAofId(aofId [16]byte) string

func (*ArbiterManager) GetCallMethods

func (self *ArbiterManager) GetCallMethods() map[string]BinaryServerProtocolCallHandler

func (*ArbiterManager) GetCurrentAofID

func (self *ArbiterManager) GetCurrentAofID() [16]byte

func (*ArbiterManager) GetMajorityMemberCount

func (self *ArbiterManager) GetMajorityMemberCount() int

func (*ArbiterManager) GetMembers

func (self *ArbiterManager) GetMembers() []*ArbiterMember

func (*ArbiterManager) Load

func (self *ArbiterManager) Load() error

func (*ArbiterManager) QuitLeader

func (self *ArbiterManager) QuitLeader() error

func (*ArbiterManager) QuitMember

func (self *ArbiterManager) QuitMember() error

func (*ArbiterManager) RemoveMember

func (self *ArbiterManager) RemoveMember(host string) error

func (*ArbiterManager) Start

func (self *ArbiterManager) Start() error

func (*ArbiterManager) StartVote

func (self *ArbiterManager) StartVote() error

func (*ArbiterManager) UpdateMember

func (self *ArbiterManager) UpdateMember(host string, weight uint32, arbiter uint32) error

type ArbiterMember

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

func NewArbiterMember

func NewArbiterMember(manager *ArbiterManager, host string, weight uint32, arbiter uint32) *ArbiterMember

func (*ArbiterMember) Close

func (self *ArbiterMember) Close() error

func (*ArbiterMember) DoAnnouncement

func (self *ArbiterMember) DoAnnouncement() (*protobuf.ArbiterAnnouncementResponse, error)

func (*ArbiterMember) DoCommit

func (self *ArbiterMember) DoCommit(proposalId uint64, host string, aofId [16]byte) (*protobuf.ArbiterCommitResponse, error)

func (*ArbiterMember) DoProposal

func (self *ArbiterMember) DoProposal(proposalId uint64, host string, aofId [16]byte) (*protobuf.ArbiterProposalResponse, error)

func (*ArbiterMember) DoVote

func (self *ArbiterMember) DoVote() (*protobuf.ArbiterVoteResponse, error)

func (*ArbiterMember) Open

func (self *ArbiterMember) Open() error

func (*ArbiterMember) Run

func (self *ArbiterMember) Run()

func (*ArbiterMember) UpdateStatus

func (self *ArbiterMember) UpdateStatus() error

func (*ArbiterMember) Wakeup

func (self *ArbiterMember) Wakeup()

type ArbiterServer

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

func NewArbiterServer

func NewArbiterServer(protocol *BinaryServerProtocol) *ArbiterServer

func (*ArbiterServer) Attach

func (self *ArbiterServer) Attach(manager *ArbiterManager, fromHost string) error

func (*ArbiterServer) Close

func (self *ArbiterServer) Close() error

func (*ArbiterServer) Run

func (self *ArbiterServer) Run()

type ArbiterStore

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

func NewArbiterStore

func NewArbiterStore() *ArbiterStore

func (*ArbiterStore) Init

func (self *ArbiterStore) Init(manager *ArbiterManager) error

func (*ArbiterStore) Load

func (self *ArbiterStore) Load(manager *ArbiterManager) error

func (*ArbiterStore) Save

func (self *ArbiterStore) Save(manager *ArbiterManager) error

type ArbiterVoter

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

func NewArbiterVoter

func NewArbiterVoter() *ArbiterVoter

func (*ArbiterVoter) Close

func (self *ArbiterVoter) Close() error

func (*ArbiterVoter) DoAnnouncement

func (self *ArbiterVoter) DoAnnouncement() error

func (*ArbiterVoter) DoCommit

func (self *ArbiterVoter) DoCommit() error

func (*ArbiterVoter) DoProposal

func (self *ArbiterVoter) DoProposal() error

func (*ArbiterVoter) DoRequests

func (self *ArbiterVoter) DoRequests(name string, handler func(*ArbiterMember) (interface{}, error)) []interface{}

func (*ArbiterVoter) DoVote

func (self *ArbiterVoter) DoVote() error

func (*ArbiterVoter) StartVote

func (self *ArbiterVoter) StartVote() error

func (*ArbiterVoter) WakeupRetryVote

func (self *ArbiterVoter) WakeupRetryVote() error

type ArbiterVoterSubscriber

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

type BinaryServerProtocol

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

func NewBinaryServerProtocol

func NewBinaryServerProtocol(slock *SLock, stream *Stream) *BinaryServerProtocol

func (*BinaryServerProtocol) AddProxy

func (self *BinaryServerProtocol) AddProxy(proxy *ProxyServerProtocol) error

func (*BinaryServerProtocol) Close

func (self *BinaryServerProtocol) Close() error

func (*BinaryServerProtocol) FindCallMethod

func (self *BinaryServerProtocol) FindCallMethod(methodName string) (BinaryServerProtocolCallHandler, error)

func (*BinaryServerProtocol) FreeLockCommand

func (self *BinaryServerProtocol) FreeLockCommand(command *protocol.LockCommand) error

func (*BinaryServerProtocol) FreeLockCommandLocked

func (self *BinaryServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error

func (*BinaryServerProtocol) GetLockCommand

func (self *BinaryServerProtocol) GetLockCommand() *protocol.LockCommand

func (*BinaryServerProtocol) GetLockCommandLocked

func (self *BinaryServerProtocol) GetLockCommandLocked() *protocol.LockCommand

func (*BinaryServerProtocol) GetProxy

func (self *BinaryServerProtocol) GetProxy() *ProxyServerProtocol

func (*BinaryServerProtocol) GetStream

func (self *BinaryServerProtocol) GetStream() *Stream

func (*BinaryServerProtocol) Init

func (self *BinaryServerProtocol) Init(clientId [16]byte) error

func (*BinaryServerProtocol) InitLockCommand

func (self *BinaryServerProtocol) InitLockCommand()

func (*BinaryServerProtocol) Lock

func (self *BinaryServerProtocol) Lock()

func (*BinaryServerProtocol) Process

func (self *BinaryServerProtocol) Process() error

func (*BinaryServerProtocol) ProcessBuild

func (self *BinaryServerProtocol) ProcessBuild(command protocol.ICommand) error

func (*BinaryServerProtocol) ProcessCommad

func (self *BinaryServerProtocol) ProcessCommad(command protocol.ICommand) error

func (*BinaryServerProtocol) ProcessLockCommand

func (self *BinaryServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error

func (*BinaryServerProtocol) ProcessLockResultCommand

func (self *BinaryServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*BinaryServerProtocol) ProcessLockResultCommandLocked

func (self *BinaryServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*BinaryServerProtocol) ProcessParse

func (self *BinaryServerProtocol) ProcessParse(buf []byte) error

func (*BinaryServerProtocol) ProcessParseLockData

func (self *BinaryServerProtocol) ProcessParseLockData() (*protocol.LockCommandData, error)

func (*BinaryServerProtocol) Read

func (*BinaryServerProtocol) ReadCommand

func (self *BinaryServerProtocol) ReadCommand() (protocol.CommandDecode, error)

func (*BinaryServerProtocol) ReadParse

func (self *BinaryServerProtocol) ReadParse(buf []byte) (protocol.CommandDecode, error)

func (*BinaryServerProtocol) RemoteAddr

func (self *BinaryServerProtocol) RemoteAddr() net.Addr

func (*BinaryServerProtocol) UnInitLockCommand

func (self *BinaryServerProtocol) UnInitLockCommand()

func (*BinaryServerProtocol) Unlock

func (self *BinaryServerProtocol) Unlock()

func (*BinaryServerProtocol) Write

func (self *BinaryServerProtocol) Write(result protocol.CommandEncode) error

func (*BinaryServerProtocol) WriteCommand

func (self *BinaryServerProtocol) WriteCommand(result protocol.CommandEncode) error

type DefaultServerProtocol

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

func NewDefaultServerProtocol

func NewDefaultServerProtocol(slock *SLock) *DefaultServerProtocol

func (*DefaultServerProtocol) AddProxy

func (self *DefaultServerProtocol) AddProxy(_ *ProxyServerProtocol) error

func (*DefaultServerProtocol) Close

func (self *DefaultServerProtocol) Close() error

func (*DefaultServerProtocol) FreeLockCommand

func (self *DefaultServerProtocol) FreeLockCommand(command *protocol.LockCommand) error

func (*DefaultServerProtocol) FreeLockCommandLocked

func (self *DefaultServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error

func (*DefaultServerProtocol) GetLockCommand

func (self *DefaultServerProtocol) GetLockCommand() *protocol.LockCommand

func (*DefaultServerProtocol) GetLockCommandLocked

func (self *DefaultServerProtocol) GetLockCommandLocked() *protocol.LockCommand

func (*DefaultServerProtocol) GetProxy

func (self *DefaultServerProtocol) GetProxy() *ProxyServerProtocol

func (*DefaultServerProtocol) GetStream

func (self *DefaultServerProtocol) GetStream() *Stream

func (*DefaultServerProtocol) Init

func (self *DefaultServerProtocol) Init(_ [16]byte) error

func (*DefaultServerProtocol) Lock

func (self *DefaultServerProtocol) Lock()

func (*DefaultServerProtocol) Process

func (self *DefaultServerProtocol) Process() error

func (*DefaultServerProtocol) ProcessBuild

func (self *DefaultServerProtocol) ProcessBuild(_ protocol.ICommand) error

func (*DefaultServerProtocol) ProcessCommad

func (self *DefaultServerProtocol) ProcessCommad(command protocol.ICommand) error

func (*DefaultServerProtocol) ProcessLockCommand

func (self *DefaultServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error

func (*DefaultServerProtocol) ProcessLockResultCommand

func (self *DefaultServerProtocol) ProcessLockResultCommand(_ *protocol.LockCommand, _ uint8, _ uint16, _ uint8, _ []byte) error

func (*DefaultServerProtocol) ProcessLockResultCommandLocked

func (self *DefaultServerProtocol) ProcessLockResultCommandLocked(_ *protocol.LockCommand, _ uint8, _ uint16, _ uint8, _ []byte) error

func (*DefaultServerProtocol) ProcessParse

func (self *DefaultServerProtocol) ProcessParse(_ []byte) error

func (*DefaultServerProtocol) Read

func (*DefaultServerProtocol) ReadCommand

func (self *DefaultServerProtocol) ReadCommand() (protocol.CommandDecode, error)

func (*DefaultServerProtocol) RemoteAddr

func (self *DefaultServerProtocol) RemoteAddr() net.Addr

func (*DefaultServerProtocol) Unlock

func (self *DefaultServerProtocol) Unlock()

func (*DefaultServerProtocol) Write

func (*DefaultServerProtocol) WriteCommand

func (self *DefaultServerProtocol) WriteCommand(protocol.CommandEncode) error

type FastKeyValue

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

type Lock

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

func NewLock

func NewLock(manager *LockManager, protocol ServerProtocol, command *protocol.LockCommand) *Lock

func (*Lock) AddLockCommandData

func (self *Lock) AddLockCommandData(lockCommandData *protocol.LockCommandData)

func (*Lock) GetDB

func (self *Lock) GetDB() *LockDB

func (*Lock) SaveRecoverData

func (self *Lock) SaveRecoverData(recoverData *LockManagerData, recoverValue interface{})

type LockCommandQueue

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

func NewLockCommandQueue

func NewLockCommandQueue(baseNodeSize int32, nodeSize int32, queueSize int32) *LockCommandQueue

func (*LockCommandQueue) Head

func (self *LockCommandQueue) Head() *protocol.LockCommand

func (*LockCommandQueue) IterNodeQueues

func (self *LockCommandQueue) IterNodeQueues(index int32) []*protocol.LockCommand

func (*LockCommandQueue) IterNodes

func (self *LockCommandQueue) IterNodes() [][]*protocol.LockCommand

func (*LockCommandQueue) Len

func (self *LockCommandQueue) Len() int32

func (*LockCommandQueue) Pop

func (self *LockCommandQueue) Pop() *protocol.LockCommand

func (*LockCommandQueue) PopRight

func (self *LockCommandQueue) PopRight() *protocol.LockCommand

func (*LockCommandQueue) Push

func (self *LockCommandQueue) Push(lock *protocol.LockCommand) error

func (*LockCommandQueue) PushLeft

func (self *LockCommandQueue) PushLeft(lock *protocol.LockCommand) error

func (*LockCommandQueue) Rellac

func (self *LockCommandQueue) Rellac() error

func (*LockCommandQueue) Reset

func (self *LockCommandQueue) Reset() error

func (*LockCommandQueue) Resize

func (self *LockCommandQueue) Resize() error

func (*LockCommandQueue) Restructuring

func (self *LockCommandQueue) Restructuring() error

func (*LockCommandQueue) Shrink

func (self *LockCommandQueue) Shrink(size int32) int32

func (*LockCommandQueue) Tail

func (self *LockCommandQueue) Tail() *protocol.LockCommand

type LockDB

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

func NewLockDB

func NewLockDB(slock *SLock, dbId uint8) *LockDB

func (*LockDB) AddExpried

func (self *LockDB) AddExpried(lock *Lock, lockExpriedTime int64)

func (*LockDB) AddMillisecondExpried

func (self *LockDB) AddMillisecondExpried(lock *Lock)

func (*LockDB) AddMillisecondTimeOut

func (self *LockDB) AddMillisecondTimeOut(lock *Lock)

func (*LockDB) AddTimeOut

func (self *LockDB) AddTimeOut(lock *Lock, lockTimeoutTime int64)

func (*LockDB) CheckProbableLock

func (self *LockDB) CheckProbableLock(serverProtocol ServerProtocol, command *protocol.LockCommand) bool

func (*LockDB) Close

func (self *LockDB) Close()

func (*LockDB) DoAckLock

func (self *LockDB) DoAckLock(lock *Lock, succed bool)

func (*LockDB) FlushDB

func (self *LockDB) FlushDB() error

func (*LockDB) GetLockManager

func (self *LockDB) GetLockManager(command *protocol.LockCommand) *LockManager

func (*LockDB) GetOrNewLockManager

func (self *LockDB) GetOrNewLockManager(command *protocol.LockCommand) *LockManager

func (*LockDB) GetState

func (self *LockDB) GetState() *protocol.LockDBState

func (*LockDB) HasLock

func (self *LockDB) HasLock(command *protocol.LockCommand, aofLockData []byte) bool

func (*LockDB) Lock

func (self *LockDB) Lock(serverProtocol ServerProtocol, command *protocol.LockCommand, lockPriorityLevel uint8) error

func (*LockDB) PushExecutorLockCommand

func (self *LockDB) PushExecutorLockCommand(lockManager *LockManager, serverProtocol ServerProtocol, lockCommand *protocol.LockCommand) error

func (*LockDB) RemoveExpried

func (self *LockDB) RemoveExpried(lock *Lock)

func (*LockDB) RemoveLockManager

func (self *LockDB) RemoveLockManager(lockManager *LockManager)

func (*LockDB) RemoveLongExpried

func (self *LockDB) RemoveLongExpried(lock *Lock)

func (*LockDB) RemoveLongTimeOut

func (self *LockDB) RemoveLongTimeOut(lock *Lock)

func (*LockDB) RemoveTimeOut

func (self *LockDB) RemoveTimeOut(lock *Lock)

func (*LockDB) UnLock

func (self *LockDB) UnLock(serverProtocol ServerProtocol, command *protocol.LockCommand, lockPriorityLevel uint8) error

type LockDBExecutor

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

func (*LockDBExecutor) Push

func (self *LockDBExecutor) Push(serverProtocol ServerProtocol, lockCommand *protocol.LockCommand)

func (*LockDBExecutor) Run

func (self *LockDBExecutor) Run()

type LockDBExecutorTask

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

type LockData

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

func (*LockData) IsEmpty

func (self *LockData) IsEmpty() bool

func (*LockData) ProcessAckClear

func (self *LockData) ProcessAckClear() bool

type LockManager

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

func NewLockManager

func NewLockManager(lockDb *LockDB, command *protocol.LockCommand, glock *PriorityMutex, glockIndex uint16, freeLocks *LockQueue, state *protocol.LockDBState) *LockManager

func (*LockManager) AddLock

func (self *LockManager) AddLock(lock *Lock) *Lock

func (*LockManager) AddWaitLock

func (self *LockManager) AddWaitLock(lock *Lock) *Lock

func (*LockManager) AofLockData

func (self *LockManager) AofLockData(commandType uint8, lock *Lock) []byte

func (*LockManager) FreeLock

func (self *LockManager) FreeLock(lock *Lock) *Lock

func (*LockManager) GetDB

func (self *LockManager) GetDB() *LockDB

func (*LockManager) GetLockData

func (self *LockManager) GetLockData() []byte

func (*LockManager) GetLockedLock

func (self *LockManager) GetLockedLock(command *protocol.LockCommand) *Lock

func (*LockManager) GetOrNewLock

func (self *LockManager) GetOrNewLock(serverProtocol ServerProtocol, command *protocol.LockCommand) *Lock

func (*LockManager) GetWaitLock

func (self *LockManager) GetWaitLock() *Lock

func (*LockManager) ProcessAckLockData

func (self *LockManager) ProcessAckLockData(lock *Lock) []byte

func (*LockManager) ProcessExecuteLockCommand

func (self *LockManager) ProcessExecuteLockCommand(lock *Lock, commandStage uint8)

func (*LockManager) ProcessLockData

func (self *LockManager) ProcessLockData(command *protocol.LockCommand, lock *Lock, requireRecover bool)

func (*LockManager) ProcessRecoverLockData

func (self *LockManager) ProcessRecoverLockData(lock *Lock)

func (*LockManager) PushLockAof

func (self *LockManager) PushLockAof(lock *Lock, aofFlag uint16) error

func (*LockManager) PushUnLockAof

func (self *LockManager) PushUnLockAof(dbId uint8, lock *Lock, lockCommand *protocol.LockCommand, unLockCommand *protocol.LockCommand, isAof bool, aofFlag uint16) error

func (*LockManager) RemoveLock

func (self *LockManager) RemoveLock(lock *Lock) *Lock

func (*LockManager) UpdateLockedLock

func (self *LockManager) UpdateLockedLock(lock *Lock, timeout uint16, timeout_flag uint16, expried uint16, expried_flag uint16, count uint16, rcount uint8)

type LockManagerData

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

func NewLockManagerData

func NewLockManagerData(data []byte, commandType uint8) *LockManagerData

func NewLockManagerDataUnsetData

func NewLockManagerDataUnsetData() *LockManagerData

func (*LockManagerData) Equal

func (self *LockManagerData) Equal(lockData []byte) bool

func (*LockManagerData) GetData

func (self *LockManagerData) GetData() []byte

func (*LockManagerData) GetIncrValue

func (self *LockManagerData) GetIncrValue() int64

type LockQueue

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

func NewLockQueue

func NewLockQueue(baseNodeSize int32, nodeSize int32, queueSize int32) *LockQueue

func (*LockQueue) Head

func (self *LockQueue) Head() *Lock

func (*LockQueue) IterNodeQueues

func (self *LockQueue) IterNodeQueues(index int32) []*Lock

func (*LockQueue) IterNodes

func (self *LockQueue) IterNodes() [][]*Lock

func (*LockQueue) Len

func (self *LockQueue) Len() int32

func (*LockQueue) Pop

func (self *LockQueue) Pop() *Lock

func (*LockQueue) PopRight

func (self *LockQueue) PopRight() *Lock

func (*LockQueue) Push

func (self *LockQueue) Push(lock *Lock) error

func (*LockQueue) PushLeft

func (self *LockQueue) PushLeft(lock *Lock) error

func (*LockQueue) Rellac

func (self *LockQueue) Rellac() error

func (*LockQueue) Reset

func (self *LockQueue) Reset() error

func (*LockQueue) Resize

func (self *LockQueue) Resize() error

func (*LockQueue) Restructuring

func (self *LockQueue) Restructuring() error

func (*LockQueue) Shrink

func (self *LockQueue) Shrink(size int32) int32

func (*LockQueue) Tail

func (self *LockQueue) Tail() *Lock

type LongWaitLockFreeQueue

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

type LongWaitLockQueue

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

type MemWaiterServerProtocol

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

func NewMemWaiterServerProtocol

func NewMemWaiterServerProtocol(slock *SLock) *MemWaiterServerProtocol

func (*MemWaiterServerProtocol) AddProxy

func (self *MemWaiterServerProtocol) AddProxy(proxy *ProxyServerProtocol) error

func (*MemWaiterServerProtocol) AddWaiter

func (self *MemWaiterServerProtocol) AddWaiter(command *protocol.LockCommand, waiter chan *protocol.LockResultCommand) error

func (*MemWaiterServerProtocol) Close

func (self *MemWaiterServerProtocol) Close() error

func (*MemWaiterServerProtocol) FreeLockCommand

func (self *MemWaiterServerProtocol) FreeLockCommand(command *protocol.LockCommand) error

func (*MemWaiterServerProtocol) FreeLockCommandLocked

func (self *MemWaiterServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error

func (*MemWaiterServerProtocol) GetLockCommand

func (self *MemWaiterServerProtocol) GetLockCommand() *protocol.LockCommand

func (*MemWaiterServerProtocol) GetLockCommandLocked

func (self *MemWaiterServerProtocol) GetLockCommandLocked() *protocol.LockCommand

func (*MemWaiterServerProtocol) GetProxy

func (self *MemWaiterServerProtocol) GetProxy() *ProxyServerProtocol

func (*MemWaiterServerProtocol) GetStream

func (self *MemWaiterServerProtocol) GetStream() *Stream

func (*MemWaiterServerProtocol) Init

func (self *MemWaiterServerProtocol) Init(_ [16]byte) error

func (*MemWaiterServerProtocol) InitLockCommand

func (self *MemWaiterServerProtocol) InitLockCommand()

func (*MemWaiterServerProtocol) Lock

func (self *MemWaiterServerProtocol) Lock()

func (*MemWaiterServerProtocol) Process

func (self *MemWaiterServerProtocol) Process() error

func (*MemWaiterServerProtocol) ProcessBuild

func (self *MemWaiterServerProtocol) ProcessBuild(_ protocol.ICommand) error

func (*MemWaiterServerProtocol) ProcessCommad

func (self *MemWaiterServerProtocol) ProcessCommad(_ protocol.ICommand) error

func (*MemWaiterServerProtocol) ProcessLockCommand

func (self *MemWaiterServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error

func (*MemWaiterServerProtocol) ProcessLockResultCommand

func (self *MemWaiterServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*MemWaiterServerProtocol) ProcessLockResultCommandLocked

func (self *MemWaiterServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*MemWaiterServerProtocol) ProcessParse

func (self *MemWaiterServerProtocol) ProcessParse(_ []byte) error

func (*MemWaiterServerProtocol) Read

func (*MemWaiterServerProtocol) ReadCommand

func (self *MemWaiterServerProtocol) ReadCommand() (protocol.CommandDecode, error)

func (*MemWaiterServerProtocol) RemoteAddr

func (self *MemWaiterServerProtocol) RemoteAddr() net.Addr

func (*MemWaiterServerProtocol) RemoveWaiter

func (self *MemWaiterServerProtocol) RemoveWaiter(command *protocol.LockCommand) error

func (*MemWaiterServerProtocol) SetResultCallback

func (self *MemWaiterServerProtocol) SetResultCallback(callback MemWaiterServerProtocolResultCallback) error

func (*MemWaiterServerProtocol) UnInitLockCommand

func (self *MemWaiterServerProtocol) UnInitLockCommand()

func (*MemWaiterServerProtocol) Unlock

func (self *MemWaiterServerProtocol) Unlock()

func (*MemWaiterServerProtocol) Write

func (*MemWaiterServerProtocol) WriteCommand

type MemWaiterServerProtocolResultCallback

type MemWaiterServerProtocolResultCallback func(*MemWaiterServerProtocol, *protocol.LockCommand, uint8, uint16, uint8, []byte) error

type MillisecondWaitLockFreeQueue

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

type PriorityMutex

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

func NewPriorityMutex

func NewPriorityMutex() *PriorityMutex

func (*PriorityMutex) HighPriorityLock

func (self *PriorityMutex) HighPriorityLock()

func (*PriorityMutex) HighPriorityMutexWait

func (self *PriorityMutex) HighPriorityMutexWait()

func (*PriorityMutex) HighPriorityUnlock

func (self *PriorityMutex) HighPriorityUnlock()

func (*PriorityMutex) HighSetPriority

func (self *PriorityMutex) HighSetPriority() bool

func (*PriorityMutex) HighUnSetPriority

func (self *PriorityMutex) HighUnSetPriority() bool

func (*PriorityMutex) Lock

func (self *PriorityMutex) Lock()

func (*PriorityMutex) LowPriorityLock

func (self *PriorityMutex) LowPriorityLock()

func (*PriorityMutex) LowPriorityUnlock

func (self *PriorityMutex) LowPriorityUnlock()

func (*PriorityMutex) LowSetPriority

func (self *PriorityMutex) LowSetPriority() bool

func (*PriorityMutex) LowUnSetPriority

func (self *PriorityMutex) LowUnSetPriority() bool

func (*PriorityMutex) Unlock

func (self *PriorityMutex) Unlock()

type ProxyServerProtocol

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

func (*ProxyServerProtocol) AddProxy

func (self *ProxyServerProtocol) AddProxy(proxyServerProtocol *ProxyServerProtocol) error

func (*ProxyServerProtocol) Close

func (self *ProxyServerProtocol) Close() error

func (*ProxyServerProtocol) FreeLockCommand

func (self *ProxyServerProtocol) FreeLockCommand(command *protocol.LockCommand) error

func (*ProxyServerProtocol) FreeLockCommandLocked

func (self *ProxyServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error

func (*ProxyServerProtocol) GetLockCommand

func (self *ProxyServerProtocol) GetLockCommand() *protocol.LockCommand

func (*ProxyServerProtocol) GetLockCommandLocked

func (self *ProxyServerProtocol) GetLockCommandLocked() *protocol.LockCommand

func (*ProxyServerProtocol) GetProxy

func (self *ProxyServerProtocol) GetProxy() *ProxyServerProtocol

func (*ProxyServerProtocol) GetStream

func (self *ProxyServerProtocol) GetStream() *Stream

func (*ProxyServerProtocol) Init

func (self *ProxyServerProtocol) Init(clientId [16]byte) error

func (*ProxyServerProtocol) Lock

func (self *ProxyServerProtocol) Lock()

func (*ProxyServerProtocol) Process

func (self *ProxyServerProtocol) Process() error

func (*ProxyServerProtocol) ProcessBuild

func (self *ProxyServerProtocol) ProcessBuild(command protocol.ICommand) error

func (*ProxyServerProtocol) ProcessCommad

func (self *ProxyServerProtocol) ProcessCommad(command protocol.ICommand) error

func (*ProxyServerProtocol) ProcessLockCommand

func (self *ProxyServerProtocol) ProcessLockCommand(command *protocol.LockCommand) error

func (*ProxyServerProtocol) ProcessLockResultCommand

func (self *ProxyServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*ProxyServerProtocol) ProcessLockResultCommandLocked

func (self *ProxyServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*ProxyServerProtocol) ProcessParse

func (self *ProxyServerProtocol) ProcessParse(buf []byte) error

func (*ProxyServerProtocol) Read

func (*ProxyServerProtocol) ReadCommand

func (self *ProxyServerProtocol) ReadCommand() (protocol.CommandDecode, error)

func (*ProxyServerProtocol) RemoteAddr

func (self *ProxyServerProtocol) RemoteAddr() net.Addr

func (*ProxyServerProtocol) Unlock

func (self *ProxyServerProtocol) Unlock()

func (*ProxyServerProtocol) Write

func (self *ProxyServerProtocol) Write(command protocol.CommandEncode) error

func (*ProxyServerProtocol) WriteCommand

func (self *ProxyServerProtocol) WriteCommand(command protocol.CommandEncode) error

type PublishLock

type PublishLock struct {
	Magic       uint8
	Version     uint8
	CommandType uint8
	RequestId   [16]byte
	Result      uint8
	Flag        uint8
	DbId        uint8
	LockId      [16]byte
	LockKey     [16]byte
	Lcount      uint16
	Count       uint16
	Lrcount     uint8
	Rcount      uint8
	// contains filtered or unexported fields
}

func NewPublishLock

func NewPublishLock() *PublishLock

func (*PublishLock) Decode

func (self *PublishLock) Decode() error

func (*PublishLock) Encode

func (self *PublishLock) Encode() error

func (*PublishLock) GetCommandType

func (self *PublishLock) GetCommandType() uint8

type ReplicationAckDB

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

func NewReplicationAckDB

func NewReplicationAckDB(manager *ReplicationManager) *ReplicationAckDB

func (*ReplicationAckDB) Close

func (self *ReplicationAckDB) Close() error

func (*ReplicationAckDB) FlushDB

func (self *ReplicationAckDB) FlushDB() error

func (*ReplicationAckDB) ProcessFollowerAckAofed

func (self *ReplicationAckDB) ProcessFollowerAckAofed(glockIndex uint16, aofLock *AofLock) error

func (*ReplicationAckDB) ProcessFollowerAckLocked

func (self *ReplicationAckDB) ProcessFollowerAckLocked(glockIndex uint16, command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8) error

func (*ReplicationAckDB) ProcessFollowerPushAckLock

func (self *ReplicationAckDB) ProcessFollowerPushAckLock(glockIndex uint16, aofLock *AofLock) error

func (*ReplicationAckDB) ProcessFollowerPushAckUnLock

func (self *ReplicationAckDB) ProcessFollowerPushAckUnLock(glockIndex uint16, aofLock *AofLock) error

func (*ReplicationAckDB) ProcessLeaderAcked

func (self *ReplicationAckDB) ProcessLeaderAcked(glockIndex uint16, aofLock *AofLock) error

func (*ReplicationAckDB) ProcessLeaderAofed

func (self *ReplicationAckDB) ProcessLeaderAofed(glockIndex uint16, aofLock *AofLock) error

func (*ReplicationAckDB) ProcessLeaderPushLock

func (self *ReplicationAckDB) ProcessLeaderPushLock(glockIndex uint16, aofLock *AofLock) error

func (*ReplicationAckDB) ProcessLeaderPushUnLock

func (self *ReplicationAckDB) ProcessLeaderPushUnLock(glockIndex uint16, aofLock *AofLock) error

func (*ReplicationAckDB) SwitchToFollower

func (self *ReplicationAckDB) SwitchToFollower() error

func (*ReplicationAckDB) SwitchToLeader

func (self *ReplicationAckDB) SwitchToLeader() error

type ReplicationAckLock

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

func NewReplicationAckLock

func NewReplicationAckLock() *ReplicationAckLock

type ReplicationBufferQueue

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

func NewReplicationBufferQueue

func NewReplicationBufferQueue(manager *ReplicationManager, bufSize uint64, maxSize uint64) *ReplicationBufferQueue

func (*ReplicationBufferQueue) AddPoll

func (*ReplicationBufferQueue) Close

func (self *ReplicationBufferQueue) Close() error

func (*ReplicationBufferQueue) Head

func (*ReplicationBufferQueue) InitFreeQueueItems

func (self *ReplicationBufferQueue) InitFreeQueueItems(count uint64)

func (*ReplicationBufferQueue) Pop

func (*ReplicationBufferQueue) Push

func (self *ReplicationBufferQueue) Push(buf []byte, data []byte) error

func (*ReplicationBufferQueue) RemovePoll

func (self *ReplicationBufferQueue) RemovePoll(cursor *ReplicationBufferQueueCursor)

func (*ReplicationBufferQueue) Search

func (self *ReplicationBufferQueue) Search(aofId [16]byte, cursor *ReplicationBufferQueueCursor) error

type ReplicationBufferQueueCursor

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

func NewReplicationBufferQueueCursor

func NewReplicationBufferQueueCursor(buf []byte) *ReplicationBufferQueueCursor

type ReplicationBufferQueueItem

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

func NewReplicationBufferQueueItem

func NewReplicationBufferQueueItem() *ReplicationBufferQueueItem

func (*ReplicationBufferQueueItem) Init

func (self *ReplicationBufferQueueItem) Init(buf []byte)

type ReplicationClient

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

func NewReplicationClient

func NewReplicationClient(manager *ReplicationManager) *ReplicationClient

func (*ReplicationClient) Close

func (self *ReplicationClient) Close() error

func (*ReplicationClient) HandleAcked

func (self *ReplicationClient) HandleAcked(ackLock *ReplicationAckLock) error

func (*ReplicationClient) InitSync

func (self *ReplicationClient) InitSync() error

func (*ReplicationClient) Open

func (self *ReplicationClient) Open(addr string) error

func (*ReplicationClient) Process

func (self *ReplicationClient) Process() error

func (*ReplicationClient) ProcessAofAppend

func (self *ReplicationClient) ProcessAofAppend()

func (*ReplicationClient) ProcessPushAofLock

func (self *ReplicationClient) ProcessPushAofLock()

func (*ReplicationClient) ProcessReplayLock

func (self *ReplicationClient) ProcessReplayLock()

func (*ReplicationClient) Run

func (self *ReplicationClient) Run()

func (*ReplicationClient) WakeupRetryConnect

func (self *ReplicationClient) WakeupRetryConnect() error

type ReplicationClientState

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

type ReplicationManager

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

func NewReplicationManager

func NewReplicationManager() *ReplicationManager

func (*ReplicationManager) ChangeLeader

func (self *ReplicationManager) ChangeLeader(address string) error

func (*ReplicationManager) Close

func (self *ReplicationManager) Close()

func (*ReplicationManager) FlushDB

func (self *ReplicationManager) FlushDB() error

func (*ReplicationManager) GetAckDB

func (self *ReplicationManager) GetAckDB(dbId uint8) *ReplicationAckDB

func (*ReplicationManager) GetCallMethods

func (self *ReplicationManager) GetCallMethods() map[string]BinaryServerProtocolCallHandler

func (*ReplicationManager) GetCurrentAofID

func (self *ReplicationManager) GetCurrentAofID() [16]byte

func (*ReplicationManager) GetHandlers

func (*ReplicationManager) GetOrNewAckDB

func (self *ReplicationManager) GetOrNewAckDB(dbId uint8) *ReplicationAckDB

func (*ReplicationManager) Init

func (self *ReplicationManager) Init(leaderAddress string, aofId [16]byte) error

func (*ReplicationManager) PushLock

func (self *ReplicationManager) PushLock(glockIndex uint16, aofLock *AofLock) error

func (*ReplicationManager) StartSync

func (self *ReplicationManager) StartSync() error

func (*ReplicationManager) SwitchToFollower

func (self *ReplicationManager) SwitchToFollower(address string) error

func (*ReplicationManager) SwitchToLeader

func (self *ReplicationManager) SwitchToLeader() error

func (*ReplicationManager) WaitInitSynced

func (self *ReplicationManager) WaitInitSynced(waiter chan bool)

func (*ReplicationManager) WaitServerSynced

func (self *ReplicationManager) WaitServerSynced() error

func (*ReplicationManager) WakeupServerChannel

func (self *ReplicationManager) WakeupServerChannel() error

type ReplicationServer

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

func NewReplicationServer

func NewReplicationServer(manager *ReplicationManager, serverProtocol *BinaryServerProtocol) *ReplicationServer

func (*ReplicationServer) Close

func (self *ReplicationServer) Close() error

func (*ReplicationServer) RecvProcess

func (self *ReplicationServer) RecvProcess() error

func (*ReplicationServer) SendProcess

func (self *ReplicationServer) SendProcess() error

type ReplicationServerState

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

type SLock

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

func NewSLock

func NewSLock(config *ServerConfig, logger logging.Logger) *SLock

func (*SLock) Close

func (self *SLock) Close()

func (*SLock) GetAdmin

func (self *SLock) GetAdmin() *Admin

func (*SLock) GetAof

func (self *SLock) GetAof() *Aof

func (*SLock) GetArbiterManager

func (self *SLock) GetArbiterManager() *ArbiterManager

func (*SLock) GetDB

func (self *SLock) GetDB(dbId uint8) *LockDB

func (*SLock) GetOrNewDB

func (self *SLock) GetOrNewDB(dbId uint8) *LockDB

func (*SLock) GetReplicationManager

func (self *SLock) GetReplicationManager() *ReplicationManager

func (*SLock) GetState

func (self *SLock) GetState(serverProtocol ServerProtocol, command *protocol.StateCommand) error

func (*SLock) GetSubscribeManager

func (self *SLock) GetSubscribeManager() *SubscribeManager

func (*SLock) Init

func (self *SLock) Init(server *Server) error

func (*SLock) Log

func (self *SLock) Log() logging.Logger

func (*SLock) Start

func (self *SLock) Start()

type Server

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

func NewServer

func NewServer(slock *SLock) *Server

func (*Server) Close

func (self *Server) Close()

func (*Server) CloseStreams

func (self *Server) CloseStreams() error

func (*Server) GetStreams

func (self *Server) GetStreams() []*Stream

func (*Server) Listen

func (self *Server) Listen() error

func (*Server) Serve

func (self *Server) Serve()

type ServerConfig

type ServerConfig struct {
	Conf                 string  `toml:"conf" long:"conf" description:"toml conf filename" default:""`
	Bind                 string  `toml:"bind" long:"bind" description:"bind address" default:"127.0.0.1"`
	Port                 uint    `toml:"port" long:"port" description:"bind port" default:"5658"`
	Log                  string  `toml:"log" long:"log" description:"log filename, default is output stdout" default:"-"`
	LogLevel             string  `` /* 133-byte string literal not displayed */
	LogRotatingSize      uint    `toml:"log_rotating_size" long:"log_rotating_size" description:"log rotating byte size" default:"67108864"`
	LogBackupCount       uint    `toml:"log_backup_count" long:"log_backup_count" description:"log backup count" default:"5"`
	LogBufferSize        uint    `toml:"log_buffer_size" long:"log_buffer_size" description:"log buffer byte size" default:"0"`
	LogBufferFlushTime   uint    `toml:"log_buffer_flush_time" long:"log_buffer_flush_time" description:"log buffer flush seconds time" default:"1"`
	DataDir              string  `toml:"data_dir" long:"data_dir" description:"data dir" default:"./data/"`
	DBFastKeyCount       uint    `toml:"db_fast_key_count" long:"db_fast_key_count" description:"db fast key count" default:"4194304"`
	DBConcurrent         uint    `toml:"db_concurrent" long:"db_concurrent" description:"db concurrent count" default:"8"`
	DBLockAofTime        uint    `toml:"db_lock_aof_time" long:"db_lock_aof_time" description:"db lock aof time" default:"1"`
	DBLockAofParcentTime float64 `toml:"db_lock_aof_parcent_time" long:"db_lock_aof_parcent_time" description:"db lock aof parcent expried time" default:"0.3"`
	AofQueueSize         uint    `toml:"aof_queue_size" long:"aof_queue_size" description:"aof channel queue size" default:"65536"`
	AofFileRewriteSize   uint    `toml:"aof_file_rewrite_size" long:"aof_file_rewrite_size" description:"aof file rewrite size" default:"67174400"`
	AofFileBufferSize    uint    `toml:"aof_file_buffer_size" long:"aof_file_buffer_size" description:"aof file buffer size" default:"4096"`
	AofRingBufferSize    uint    `toml:"aof_ring_buffer_size" long:"aof_ring_buffer_size" description:"slave sync ring buffer size" default:"4194304"`
	AofRingBufferMaxSize uint    `` /* 129-byte string literal not displayed */
	SlaveOf              string  `toml:"slaveof" long:"slaveof" description:"slave of to master sync" default:""`
	ReplSet              string  `toml:"replset" long:"replset" description:"replset name, start replset mode when it set" default:""`
}
var Config *ServerConfig = nil

func ExtendConfig

func ExtendConfig(config *ServerConfig, oconfig *ServerConfig) *ServerConfig

func GetConfig

func GetConfig() *ServerConfig

type ServerProtocol

type ServerProtocol interface {
	Init(clientId [16]byte) error
	Lock()
	Unlock()
	Read() (protocol.CommandDecode, error)
	Write(protocol.CommandEncode) error
	ReadCommand() (protocol.CommandDecode, error)
	WriteCommand(protocol.CommandEncode) error
	Process() error
	ProcessParse(buf []byte) error
	ProcessBuild(command protocol.ICommand) error
	ProcessCommad(command protocol.ICommand) error
	ProcessLockCommand(command *protocol.LockCommand) error
	ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
	ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error
	Close() error
	GetStream() *Stream
	GetProxy() *ProxyServerProtocol
	AddProxy(proxy *ProxyServerProtocol) error
	RemoteAddr() net.Addr
	GetLockCommand() *protocol.LockCommand
	GetLockCommandLocked() *protocol.LockCommand
	FreeLockCommand(command *protocol.LockCommand) error
	FreeLockCommandLocked(command *protocol.LockCommand) error
}

type ServerProtocolSession

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

type Stream

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

func NewStream

func NewStream(conn net.Conn) *Stream

func (*Stream) Close

func (self *Stream) Close() error

func (*Stream) LocalAddr

func (self *Stream) LocalAddr() net.Addr

func (*Stream) Read

func (self *Stream) Read(buf []byte) (int, error)

func (*Stream) ReadBytes

func (self *Stream) ReadBytes(buf []byte) (int, error)

func (*Stream) ReadBytesFrame

func (self *Stream) ReadBytesFrame() ([]byte, error)

func (*Stream) ReadBytesSize

func (self *Stream) ReadBytesSize(size int) ([]byte, error)

func (*Stream) ReadFromConn

func (self *Stream) ReadFromConn(buf []byte) (int, error)

func (*Stream) ReadSize

func (self *Stream) ReadSize(size int) ([]byte, error)

func (*Stream) RemoteAddr

func (self *Stream) RemoteAddr() net.Addr

func (*Stream) SetDeadline

func (self *Stream) SetDeadline(t time.Time) error

func (*Stream) SetReadDeadline

func (self *Stream) SetReadDeadline(t time.Time) error

func (*Stream) SetWriteDeadline

func (self *Stream) SetWriteDeadline(t time.Time) error

func (*Stream) Write

func (self *Stream) Write(b []byte) (int, error)

func (*Stream) WriteBytes

func (self *Stream) WriteBytes(b []byte) error

type StreamReaderBuffer

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

func NewStreamReaderBuffer

func NewStreamReaderBuffer(size int) *StreamReaderBuffer

func (*StreamReaderBuffer) GetCapSize

func (self *StreamReaderBuffer) GetCapSize() int

func (*StreamReaderBuffer) GetSize

func (self *StreamReaderBuffer) GetSize() int

func (*StreamReaderBuffer) Read

func (self *StreamReaderBuffer) Read(buf []byte) int

func (*StreamReaderBuffer) ReadBytesSize

func (self *StreamReaderBuffer) ReadBytesSize(size int) []byte

func (*StreamReaderBuffer) ReadFromConn

func (self *StreamReaderBuffer) ReadFromConn(conn net.Conn, size int) (int, error)

type SubscribeBuffer

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

type SubscribeChannel

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

func NewSubscribeChannel

func NewSubscribeChannel(manager *SubscribeManager, lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *SubscribeChannel

func (*SubscribeChannel) ClientPush

func (self *SubscribeChannel) ClientPush(lock *PublishLock) error

func (*SubscribeChannel) Push

func (self *SubscribeChannel) Push(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*SubscribeChannel) Run

func (self *SubscribeChannel) Run()

type SubscribeClient

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

func NewSubscribeClient

func NewSubscribeClient(manager *SubscribeManager) *SubscribeClient

func (*SubscribeClient) Close

func (self *SubscribeClient) Close() error

func (*SubscribeClient) Open

func (self *SubscribeClient) Open(leaderAddress string) error

func (*SubscribeClient) Process

func (self *SubscribeClient) Process() error

func (*SubscribeClient) Run

func (self *SubscribeClient) Run()

func (*SubscribeClient) WakeupRetryConnect

func (self *SubscribeClient) WakeupRetryConnect() error

type SubscribeManager

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

func NewSubscribeManager

func NewSubscribeManager() *SubscribeManager

func (*SubscribeManager) ChangeLeader

func (self *SubscribeManager) ChangeLeader(address string) error

func (*SubscribeManager) Close

func (self *SubscribeManager) Close()

func (*SubscribeManager) CloseSubscribeChannel

func (self *SubscribeManager) CloseSubscribeChannel(aofChannel *SubscribeChannel) *SubscribeChannel

func (*SubscribeManager) NewSubscribeChannel

func (self *SubscribeManager) NewSubscribeChannel(lockDb *LockDB, lockDbGlockIndex uint16, lockDbGlock *PriorityMutex) *SubscribeChannel

func (*SubscribeManager) RemoveSubscribeChannel

func (self *SubscribeManager) RemoveSubscribeChannel(aofChannel *SubscribeChannel) *SubscribeChannel

func (*SubscribeManager) WaitFlushSubscribeChannel

func (self *SubscribeManager) WaitFlushSubscribeChannel() error

type SubscribePublishLockQueue

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

type Subscriber

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

func NewSubscriber

func NewSubscriber(manager *SubscribeManager, serverProtocol ServerProtocol, clientId uint32, subscriberId uint32) *Subscriber

func (*Subscriber) Close

func (self *Subscriber) Close() error

func (*Subscriber) Push

func (self *Subscriber) Push(lock *PublishLock) error

func (*Subscriber) Run

func (self *Subscriber) Run()

func (*Subscriber) Update

func (self *Subscriber) Update(serverProtocol ServerProtocol, subscriberType uint8, publishId [16]byte, expried uint32, maxSize uint32) error

type TextServerProtocol

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

func NewTextServerProtocol

func NewTextServerProtocol(slock *SLock, stream *Stream) *TextServerProtocol

func (*TextServerProtocol) AddProxy

func (self *TextServerProtocol) AddProxy(proxy *ProxyServerProtocol) error

func (*TextServerProtocol) ArgsToLockComand

func (self *TextServerProtocol) ArgsToLockComand(args []string) (*protocol.LockCommand, error)

func (*TextServerProtocol) ArgsToLockComandParseId

func (self *TextServerProtocol) ArgsToLockComandParseId(argId string, lockId *[16]byte)

func (*TextServerProtocol) Close

func (self *TextServerProtocol) Close() error

func (*TextServerProtocol) FindHandler

func (*TextServerProtocol) FreeLockCommand

func (self *TextServerProtocol) FreeLockCommand(command *protocol.LockCommand) error

func (*TextServerProtocol) FreeLockCommandLocked

func (self *TextServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error

func (*TextServerProtocol) GetLockCommand

func (self *TextServerProtocol) GetLockCommand() *protocol.LockCommand

func (*TextServerProtocol) GetLockCommandLocked

func (self *TextServerProtocol) GetLockCommandLocked() *protocol.LockCommand

func (*TextServerProtocol) GetParser

func (self *TextServerProtocol) GetParser() *protocol.TextParser

func (*TextServerProtocol) GetProxy

func (self *TextServerProtocol) GetProxy() *ProxyServerProtocol

func (*TextServerProtocol) GetRequestId

func (self *TextServerProtocol) GetRequestId() [16]byte

func (*TextServerProtocol) GetStream

func (self *TextServerProtocol) GetStream() *Stream

func (*TextServerProtocol) Init

func (self *TextServerProtocol) Init(_ [16]byte) error

func (*TextServerProtocol) InitLockCommand

func (self *TextServerProtocol) InitLockCommand()

func (*TextServerProtocol) Lock

func (self *TextServerProtocol) Lock()

func (*TextServerProtocol) Process

func (self *TextServerProtocol) Process() error

func (*TextServerProtocol) ProcessBuild

func (self *TextServerProtocol) ProcessBuild(command protocol.ICommand) error

func (*TextServerProtocol) ProcessCommad

func (self *TextServerProtocol) ProcessCommad(command protocol.ICommand) error

func (*TextServerProtocol) ProcessLockCommand

func (self *TextServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error

func (*TextServerProtocol) ProcessLockResultCommand

func (self *TextServerProtocol) ProcessLockResultCommand(lockCommand *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*TextServerProtocol) ProcessLockResultCommandLocked

func (self *TextServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*TextServerProtocol) ProcessParse

func (self *TextServerProtocol) ProcessParse(buf []byte) error

func (*TextServerProtocol) Read

func (*TextServerProtocol) ReadCommand

func (self *TextServerProtocol) ReadCommand() (protocol.CommandDecode, error)

func (*TextServerProtocol) RemoteAddr

func (self *TextServerProtocol) RemoteAddr() net.Addr

func (*TextServerProtocol) RunCommand

func (self *TextServerProtocol) RunCommand() error

func (*TextServerProtocol) UnInitLockCommand

func (self *TextServerProtocol) UnInitLockCommand()

func (*TextServerProtocol) Unlock

func (self *TextServerProtocol) Unlock()

func (*TextServerProtocol) Write

func (self *TextServerProtocol) Write(result protocol.CommandEncode) error

func (*TextServerProtocol) WriteCommand

func (self *TextServerProtocol) WriteCommand(result protocol.CommandEncode) error

type TextServerProtocolCommandHandler

type TextServerProtocolCommandHandler func(*TextServerProtocol, []string) error

type TransparencyBinaryClientProtocol

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

func NewTransparencyBinaryClientProtocol

func NewTransparencyBinaryClientProtocol(manager *TransparencyManager) *TransparencyBinaryClientProtocol

func (*TransparencyBinaryClientProtocol) Close

func (*TransparencyBinaryClientProtocol) Open

func (self *TransparencyBinaryClientProtocol) Open(leaderAddress string) error

func (*TransparencyBinaryClientProtocol) Process

func (self *TransparencyBinaryClientProtocol) Process()

func (*TransparencyBinaryClientProtocol) RetryOpen

func (self *TransparencyBinaryClientProtocol) RetryOpen(leaderAddress string) error

func (*TransparencyBinaryClientProtocol) Write

type TransparencyBinaryServerProtocol

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

func NewTransparencyBinaryServerProtocol

func NewTransparencyBinaryServerProtocol(slock *SLock, stream *Stream, serverProtocol *BinaryServerProtocol) *TransparencyBinaryServerProtocol

func (*TransparencyBinaryServerProtocol) AddProxy

func (*TransparencyBinaryServerProtocol) CheckClient

func (*TransparencyBinaryServerProtocol) Close

func (*TransparencyBinaryServerProtocol) FreeLockCommand

func (self *TransparencyBinaryServerProtocol) FreeLockCommand(command *protocol.LockCommand) error

func (*TransparencyBinaryServerProtocol) FreeLockCommandLocked

func (self *TransparencyBinaryServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error

func (*TransparencyBinaryServerProtocol) GetLockCommand

func (self *TransparencyBinaryServerProtocol) GetLockCommand() *protocol.LockCommand

func (*TransparencyBinaryServerProtocol) GetLockCommandLocked

func (self *TransparencyBinaryServerProtocol) GetLockCommandLocked() *protocol.LockCommand

func (*TransparencyBinaryServerProtocol) GetProxy

func (*TransparencyBinaryServerProtocol) GetStream

func (self *TransparencyBinaryServerProtocol) GetStream() *Stream

func (*TransparencyBinaryServerProtocol) Init

func (self *TransparencyBinaryServerProtocol) Init(clientId [16]byte) error

func (*TransparencyBinaryServerProtocol) InitLockCommand

func (self *TransparencyBinaryServerProtocol) InitLockCommand()

func (*TransparencyBinaryServerProtocol) Lock

func (self *TransparencyBinaryServerProtocol) Lock()

func (*TransparencyBinaryServerProtocol) Process

func (self *TransparencyBinaryServerProtocol) Process() error

func (*TransparencyBinaryServerProtocol) ProcessBuild

func (self *TransparencyBinaryServerProtocol) ProcessBuild(command protocol.ICommand) error

func (*TransparencyBinaryServerProtocol) ProcessCommad

func (self *TransparencyBinaryServerProtocol) ProcessCommad(command protocol.ICommand) error

func (*TransparencyBinaryServerProtocol) ProcessLockCommand

func (self *TransparencyBinaryServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error

func (*TransparencyBinaryServerProtocol) ProcessLockResultCommand

func (self *TransparencyBinaryServerProtocol) ProcessLockResultCommand(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*TransparencyBinaryServerProtocol) ProcessLockResultCommandLocked

func (self *TransparencyBinaryServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*TransparencyBinaryServerProtocol) ProcessParse

func (self *TransparencyBinaryServerProtocol) ProcessParse(buf []byte) error

func (*TransparencyBinaryServerProtocol) Read

func (*TransparencyBinaryServerProtocol) ReadCommand

func (*TransparencyBinaryServerProtocol) RemoteAddr

func (self *TransparencyBinaryServerProtocol) RemoteAddr() net.Addr

func (*TransparencyBinaryServerProtocol) UnInitLockCommand

func (self *TransparencyBinaryServerProtocol) UnInitLockCommand()

func (*TransparencyBinaryServerProtocol) Unlock

func (self *TransparencyBinaryServerProtocol) Unlock()

func (*TransparencyBinaryServerProtocol) Write

func (*TransparencyBinaryServerProtocol) WriteCommand

func (self *TransparencyBinaryServerProtocol) WriteCommand(result protocol.CommandEncode) error

type TransparencyManager

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

func NewTransparencyManager

func NewTransparencyManager() *TransparencyManager

func (*TransparencyManager) AcquireClient

func (self *TransparencyManager) AcquireClient(serverProtocol ServerProtocol) (*TransparencyBinaryClientProtocol, error)

func (*TransparencyManager) ChangeLeader

func (self *TransparencyManager) ChangeLeader(address string) error

func (*TransparencyManager) CheckArbiterWaiter

func (self *TransparencyManager) CheckArbiterWaiter() int

func (*TransparencyManager) Close

func (self *TransparencyManager) Close() error

func (*TransparencyManager) CloseClient

func (self *TransparencyManager) CloseClient(binaryClient *TransparencyBinaryClientProtocol) error

func (*TransparencyManager) OpenClient

func (*TransparencyManager) ReleaseClient

func (self *TransparencyManager) ReleaseClient(binaryClient *TransparencyBinaryClientProtocol) error

func (*TransparencyManager) Run

func (self *TransparencyManager) Run()

func (*TransparencyManager) Wakeup

func (self *TransparencyManager) Wakeup()

type TransparencyTextServerProtocol

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

func NewTransparencyTextServerProtocol

func NewTransparencyTextServerProtocol(slock *SLock, stream *Stream, serverProtocol *TextServerProtocol) *TransparencyTextServerProtocol

func (*TransparencyTextServerProtocol) AddProxy

func (*TransparencyTextServerProtocol) CheckClient

func (*TransparencyTextServerProtocol) Close

func (self *TransparencyTextServerProtocol) Close() error

func (*TransparencyTextServerProtocol) FindHandler

func (*TransparencyTextServerProtocol) FreeLockCommand

func (self *TransparencyTextServerProtocol) FreeLockCommand(command *protocol.LockCommand) error

func (*TransparencyTextServerProtocol) FreeLockCommandLocked

func (self *TransparencyTextServerProtocol) FreeLockCommandLocked(command *protocol.LockCommand) error

func (*TransparencyTextServerProtocol) GetLockCommand

func (self *TransparencyTextServerProtocol) GetLockCommand() *protocol.LockCommand

func (*TransparencyTextServerProtocol) GetLockCommandLocked

func (self *TransparencyTextServerProtocol) GetLockCommandLocked() *protocol.LockCommand

func (*TransparencyTextServerProtocol) GetParser

func (*TransparencyTextServerProtocol) GetProxy

func (*TransparencyTextServerProtocol) GetStream

func (self *TransparencyTextServerProtocol) GetStream() *Stream

func (*TransparencyTextServerProtocol) Init

func (self *TransparencyTextServerProtocol) Init(_ [16]byte) error

func (*TransparencyTextServerProtocol) InitLockCommand

func (self *TransparencyTextServerProtocol) InitLockCommand()

func (*TransparencyTextServerProtocol) Lock

func (self *TransparencyTextServerProtocol) Lock()

func (*TransparencyTextServerProtocol) Process

func (self *TransparencyTextServerProtocol) Process() error

func (*TransparencyTextServerProtocol) ProcessBuild

func (self *TransparencyTextServerProtocol) ProcessBuild(command protocol.ICommand) error

func (*TransparencyTextServerProtocol) ProcessCommad

func (self *TransparencyTextServerProtocol) ProcessCommad(command protocol.ICommand) error

func (*TransparencyTextServerProtocol) ProcessLockCommand

func (self *TransparencyTextServerProtocol) ProcessLockCommand(lockCommand *protocol.LockCommand) error

func (*TransparencyTextServerProtocol) ProcessLockResultCommand

func (self *TransparencyTextServerProtocol) ProcessLockResultCommand(lockCommand *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*TransparencyTextServerProtocol) ProcessLockResultCommandLocked

func (self *TransparencyTextServerProtocol) ProcessLockResultCommandLocked(command *protocol.LockCommand, result uint8, lcount uint16, lrcount uint8, data []byte) error

func (*TransparencyTextServerProtocol) ProcessParse

func (self *TransparencyTextServerProtocol) ProcessParse(buf []byte) error

func (*TransparencyTextServerProtocol) Read

func (*TransparencyTextServerProtocol) ReadCommand

func (*TransparencyTextServerProtocol) RemoteAddr

func (self *TransparencyTextServerProtocol) RemoteAddr() net.Addr

func (*TransparencyTextServerProtocol) RunCommand

func (self *TransparencyTextServerProtocol) RunCommand() error

func (*TransparencyTextServerProtocol) UnInitLockCommand

func (self *TransparencyTextServerProtocol) UnInitLockCommand()

func (*TransparencyTextServerProtocol) Unlock

func (self *TransparencyTextServerProtocol) Unlock()

func (*TransparencyTextServerProtocol) Write

func (*TransparencyTextServerProtocol) WriteCommand

func (self *TransparencyTextServerProtocol) WriteCommand(result protocol.CommandEncode) error

Jump to

Keyboard shortcuts

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