Documentation
¶
Index ¶
- func NewBackendConn(lg *zap.Logger, connID uint64, hsHandler backend.HandshakeHandler, ...) *backendConn
- func NewConn(lg *zap.Logger, username, password string, backendTLSConfig *tls.Config, ...) *conn
- type BackendConn
- type BackendConnManager
- type Conn
- type ConnCreator
- type Exception
- type ExceptionType
- type FailException
- type OtherException
- type ReplayStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBackendConn ¶
Types ¶
type BackendConn ¶
type BackendConn interface {
Connect(ctx context.Context) error
ConnID() uint64
ExecuteCmd(ctx context.Context, request []byte) error
Query(ctx context.Context, stmt string) error
PrepareStmt(ctx context.Context, stmt string) (stmtID uint32, err error)
ExecuteStmt(ctx context.Context, stmtID uint32, args []any) error
GetPreparedStmt(stmtID uint32) (text string, paramNum int, paramTypes []byte)
Close()
}
type BackendConnManager ¶
type ConnCreator ¶
type Exception ¶
type Exception interface {
Type() ExceptionType
Key() string
ConnID() uint64
Time() time.Time
}
type ExceptionType ¶
type ExceptionType int
const ( // connect error, handshake error Other ExceptionType = iota // execute error Fail // the error type count Total )
func (ExceptionType) String ¶
func (t ExceptionType) String() string
type FailException ¶
type FailException struct {
// contains filtered or unexported fields
}
func NewFailException ¶
func NewFailException(err error, command *cmd.Command) *FailException
func (*FailException) Command ¶
func (fe *FailException) Command() *cmd.Command
func (*FailException) ConnID ¶
func (fe *FailException) ConnID() uint64
func (*FailException) Error ¶
func (fe *FailException) Error() string
func (*FailException) Key ¶
func (fe *FailException) Key() string
func (*FailException) Time ¶
func (fe *FailException) Time() time.Time
func (*FailException) Type ¶
func (fe *FailException) Type() ExceptionType
type OtherException ¶
type OtherException struct {
// contains filtered or unexported fields
}
func NewOtherException ¶
func NewOtherException(err error, connID uint64) *OtherException
func (*OtherException) ConnID ¶
func (oe *OtherException) ConnID() uint64
func (*OtherException) Error ¶
func (oe *OtherException) Error() string
func (*OtherException) Key ¶
func (oe *OtherException) Key() string
func (*OtherException) Time ¶
func (oe *OtherException) Time() time.Time
func (*OtherException) Type ¶
func (oe *OtherException) Type() ExceptionType
type ReplayStats ¶
type ReplayStats struct {
// ReplayedCmds is the number of executed commands.
ReplayedCmds atomic.Uint64
// PendingCmds is the number of decoded but not executed commands.
PendingCmds atomic.Int64
}
ReplayStats record the statistics during replay. All connections share one ReplayStats and update it concurrently.
func (*ReplayStats) Reset ¶
func (s *ReplayStats) Reset()
Click to show internal directories.
Click to hide internal directories.