Documentation ¶
Index ¶
- Variables
- func PutMsgBatchs(mbs []*MsgBatch)
- func PutMsgs(msgs []*Message)
- type CacheType
- type Message
- func (m *Message) Batch() []*Message
- func (m *Message) DoneWithError(err error)
- func (m *Message) Err() error
- func (m *Message) IsBatch() bool
- func (m *Message) MarkEnd()
- func (m *Message) MarkRead()
- func (m *Message) MarkStart()
- func (m *Message) MarkWrite()
- func (m *Message) NextReq() (req Request)
- func (m *Message) RemoteDur() time.Duration
- func (m *Message) Request() Request
- func (m *Message) Requests() []Request
- func (m *Message) Reset()
- func (m *Message) ResetSubs()
- func (m *Message) TotalDur() time.Duration
- func (m *Message) WithRequest(req Request)
- type MsgBatch
- func (m *MsgBatch) Add(n int)
- func (m *MsgBatch) AddMsg(msg *Message)
- func (m *MsgBatch) BatchDone(cluster, addr string)
- func (m *MsgBatch) BatchDoneWithError(cluster, addr string, err error)
- func (m *MsgBatch) Buffer() *bufio.Buffer
- func (m *MsgBatch) Count() int
- func (m *MsgBatch) Done()
- func (m *MsgBatch) Msgs() []*Message
- func (m *MsgBatch) Nth(i int) *Message
- func (m *MsgBatch) Reset()
- func (m *MsgBatch) Wait()
- type MsgChan
- type NodeConn
- type ProxyConn
- type Request
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoSupportCacheType = errs.New("unsupported cache type")
)
errors
Functions ¶
func PutMsgBatchs ¶
func PutMsgBatchs(mbs []*MsgBatch)
PutMsgBatchs put MsgBatchs into recycle using pool.
Types ¶
type Message ¶
type Message struct { Type CacheType // contains filtered or unexported fields }
Message read from client.
func NewMessage ¶
func NewMessage() *Message
NewMessage will create new message object. this will be used be sub msg req.
func (*Message) DoneWithError ¶
DoneWithError done with error.
func (*Message) MarkEnd ¶
func (m *Message) MarkEnd()
MarkEnd will set the end time of the command to now.
func (*Message) MarkRead ¶
func (m *Message) MarkRead()
MarkRead will set the read time of the command to now.
func (*Message) MarkStart ¶
func (m *Message) MarkStart()
MarkStart will set the start time of the command to now.
func (*Message) MarkWrite ¶
func (m *Message) MarkWrite()
MarkWrite will set the write time of the command to now.
func (*Message) ResetSubs ¶
func (m *Message) ResetSubs()
ResetSubs will return the Msg data to flush and reset
func (*Message) WithRequest ¶
WithRequest with proto request.
type MsgBatch ¶
type MsgBatch struct {
// contains filtered or unexported fields
}
MsgBatch is a single execute unit
func (*MsgBatch) BatchDoneWithError ¶
BatchDoneWithError will set done with error and report prom ErrIncr.
func (*MsgBatch) Done ¶
func (m *MsgBatch) Done()
Done will set the total batch to done and notify the handler to check it.
type MsgChan ¶
type MsgChan struct {
// contains filtered or unexported fields
}
MsgChan is queue be used process Msg.
func NewMsgChanBuffer ¶
NewMsgChanBuffer new Msg chan with buffer.
type NodeConn ¶
type NodeConn interface { WriteBatch(*MsgBatch) error ReadBatch(*MsgBatch) error Ping() error Close() error }
NodeConn handle Msg to backend cache server and read response.