Documentation ¶
Index ¶
- Constants
- Variables
- func GetErrorCode(err error) (code int)
- func GetErrorMessage(code int) (err error)
- type AckMessage
- type ErrorHandler
- type ErrorMessage
- type HeartbeatMessage
- type Message
- type MessageReader
- type MessageWriter
- type RecordMessage
- type TCPPeer
- type TCPReader
- func (tr *TCPReader) Close() (err error)
- func (tr *TCPReader) Fill() (err error)
- func (tr *TCPReader) Flush() (err error)
- func (tr *TCPReader) HandleError(h ErrorHandler)
- func (tr *TCPReader) Read(r *log.Record) (n int, err error)
- func (tr *TCPReader) WriteAck(progress *log.SyncProgress) (n int, err error)
- func (tr *TCPReader) WriteError(er error) (n int, err error)
- type TCPWriter
- func (tw *TCPWriter) Close() (err error)
- func (tw *TCPWriter) Flush() (err error)
- func (tw *TCPWriter) HandleError(h ErrorHandler)
- func (tw *TCPWriter) HandleSync(h log.SyncHandler)
- func (tw *TCPWriter) Write(r *log.Record) (n int, err error)
- func (tw *TCPWriter) WriteError(er error) (n int, err error)
Constants ¶
View Source
const ( TypeRecordMessage = iota + 1 TypeAckMessage TypeHeartbeatMessage TypeErrorMessage )
Variables ¶
View Source
var ( ErrUnkownMessageType = errors.New("tcp: unknown message type") ErrUnexpectedMessageType = errors.New("tcp: unexpected message type") )
View Source
var (
ErrClosed = errors.New("peer: closed")
)
View Source
var (
ErrUnknownError = errors.New("tcp: unknown error")
)
Functions ¶
func GetErrorCode ¶
func GetErrorMessage ¶
Types ¶
type AckMessage ¶
type ErrorHandler ¶
type ErrorHandler func(err error)
type ErrorMessage ¶
type ErrorMessage struct {
Code int
}
type HeartbeatMessage ¶
type HeartbeatMessage struct { }
type Message ¶
type Message struct { Type int Payload recio.EncodeDecoder // contains filtered or unexported fields }
type MessageReader ¶
type MessageReader struct {
// contains filtered or unexported fields
}
func NewMessageReader ¶
func (*MessageReader) Fill ¶
func (mr *MessageReader) Fill() (err error)
func (*MessageReader) ReadMessage ¶
func (mr *MessageReader) ReadMessage(m *Message) (n int, err error)
type MessageWriter ¶
type MessageWriter struct {
// contains filtered or unexported fields
}
func NewMessageWriter ¶
func (*MessageWriter) Flush ¶
func (mw *MessageWriter) Flush() (err error)
func (*MessageWriter) WriteMessage ¶
func (mw *MessageWriter) WriteMessage(m *Message) (n int, err error)
type RecordMessage ¶
type TCPPeer ¶
type TCPPeer struct {
// contains filtered or unexported fields
}
func NewTCPPeer ¶
func (*TCPPeer) HandleError ¶
func (tp *TCPPeer) HandleError(h ErrorHandler)
type TCPReader ¶
type TCPReader struct {
// contains filtered or unexported fields
}
func NewTCPReader ¶
func (*TCPReader) HandleError ¶
func (tr *TCPReader) HandleError(h ErrorHandler)
type TCPWriter ¶
type TCPWriter struct {
// contains filtered or unexported fields
}
func NewTCPWriter ¶
func (*TCPWriter) HandleError ¶
func (tw *TCPWriter) HandleError(h ErrorHandler)
func (*TCPWriter) HandleSync ¶
func (tw *TCPWriter) HandleSync(h log.SyncHandler)
Click to show internal directories.
Click to hide internal directories.