func (m *MockNetpollConn) Writer() (r netpoll.Writer) {
	if m.WriterFunc != nil {
		return m.WriterFunc()
	}
	return
}
Writer implements the netpoll.Connection interface.
package netpollmux
import (
	"context"
	"time"
	"github.com/cloudwego/netpoll"
	"github.com/cloudwego/kitex/internal/mocks"
	"github.com/cloudwego/kitex/pkg/remote"
	"github.com/cloudwego/kitex/pkg/rpcinfo"
	"github.com/cloudwego/kitex/pkg/serviceinfo"
)
func newMockRPCInfo() rpcinfo.RPCInfo {
	method := "method"
	c := rpcinfo.NewEndpointInfo("", method, nil, nil)
	s := rpcinfo.NewEndpointInfo("", method, nil, nil)
	ink := rpcinfo.NewInvocation("", method)
	cfg := rpcinfo.NewRPCConfig()
	ri := rpcinfo.NewRPCInfo(c, s, ink, cfg, rpcinfo.NewRPCStats())
	return ri
}
var _ remote.Codec = &MockCodec{}
type MockCodec struct {
	EncodeFunc func(ctx context.Context, msg remote.Message, out remote.ByteBuffer) error
	DecodeFunc func(ctx context.Context, msg remote.Message, in remote.ByteBuffer) error
	NameFunc   func() string
}
func (m *MockCodec) Encode(ctx context.Context, msg remote.Message, out remote.ByteBuffer) error {
	if m.EncodeFunc != nil {
		return m.EncodeFunc(ctx, msg, out)
	}
	return nil
}
func (m *MockCodec) Decode(ctx context.Context, msg remote.Message, in remote.ByteBuffer) error {
	if m.DecodeFunc != nil {
		return m.DecodeFunc(ctx, msg, in)
	}
	return nil
}
func (m *MockCodec) Name() string {
	if m.NameFunc != nil {
		return m.NameFunc()
	}
	return ""
}
var _ remote.Message = &MockMessage{}
type MockMessage struct {
	RPCInfoFunc         func() rpcinfo.RPCInfo
	ServiceInfoFunc     func() *serviceinfo.ServiceInfo
	DataFunc            func() interface{}
	NewDataFunc         func(method string) (ok bool)
	MessageTypeFunc     func() remote.MessageType
	SetMessageTypeFunc  func(remote.MessageType)
	RPCRoleFunc         func() remote.RPCRole
	PayloadLenFunc      func() int
	SetPayloadLenFunc   func(size int)
	TransInfoFunc       func() remote.TransInfo
	TagsFunc            func() map[string]interface{}
	ProtocolInfoFunc    func() remote.ProtocolInfo
	SetProtocolInfoFunc func(remote.ProtocolInfo)
	PayloadCodecFunc    func() remote.PayloadCodec
	SetPayloadCodecFunc func(pc remote.PayloadCodec)
	RecycleFunc         func()
}
func (m *MockMessage) RPCInfo() rpcinfo.RPCInfo {
	if m.RPCInfoFunc != nil {
		return m.RPCInfoFunc()
	}
	return nil
}
func (m *MockMessage) ServiceInfo() (si *serviceinfo.ServiceInfo) {
	if m.ServiceInfoFunc != nil {
		return m.ServiceInfoFunc()
	}
	return
}
func (m *MockMessage) Data() interface{} {
	if m.DataFunc != nil {
		return m.DataFunc()
	}
	return nil
}
func (m *MockMessage) NewData(method string) (ok bool) {
	if m.NewDataFunc != nil {
		return m.NewDataFunc(method)
	}
	return false
}
func (m *MockMessage) MessageType() (mt remote.MessageType) {
	if m.MessageTypeFunc != nil {
		return m.MessageTypeFunc()
	}
	return
}
func (m *MockMessage) SetMessageType(mt remote.MessageType) {
	if m.SetMessageTypeFunc != nil {
		m.SetMessageTypeFunc(mt)
	}
}
func (m *MockMessage) RPCRole() (r remote.RPCRole) {
	if m.RPCRoleFunc != nil {
		return m.RPCRoleFunc()
	}
	return
}
func (m *MockMessage) PayloadLen() int {
	if m.PayloadLenFunc != nil {
		return m.PayloadLenFunc()
	}
	return 0
}
func (m *MockMessage) SetPayloadLen(size int) {
	if m.SetPayloadLenFunc != nil {
		m.SetPayloadLenFunc(size)
	}
}
func (m *MockMessage) TransInfo() remote.TransInfo {
	if m.TransInfoFunc != nil {
		return m.TransInfoFunc()
	}
	return nil
}
func (m *MockMessage) Tags() map[string]interface{} {
	if m.TagsFunc != nil {
		return m.TagsFunc()
	}
	return nil
}
func (m *MockMessage) ProtocolInfo() (pi remote.ProtocolInfo) {
	if m.ProtocolInfoFunc != nil {
		return m.ProtocolInfoFunc()
	}
	return
}
func (m *MockMessage) SetProtocolInfo(pi remote.ProtocolInfo) {
	if m.SetProtocolInfoFunc != nil {
		m.SetProtocolInfoFunc(pi)
	}
}
func (m *MockMessage) PayloadCodec() remote.PayloadCodec {
	if m.PayloadCodecFunc != nil {
		return m.PayloadCodecFunc()
	}
	return nil
}
func (m *MockMessage) SetPayloadCodec(pc remote.PayloadCodec) {
	if m.SetPayloadCodecFunc != nil {
		m.SetPayloadCodecFunc(pc)
	}
}
func (m *MockMessage) Recycle() {
	if m.RecycleFunc != nil {
		m.RecycleFunc()
	}
}
var _ netpoll.Connection = &MockNetpollConn{}
type MockNetpollConn struct {
	mocks.Conn
	AddCloseCallbackFunc func(c netpoll.CloseCallback) (e error)
	IsActiveFunc         func() (r bool)
	ReaderFunc           func() (r netpoll.Reader)
	WriterFunc           func() (r netpoll.Writer)
	SetIdleTimeoutFunc   func(timeout time.Duration) (e error)
	SetOnRequestFunc     func(on netpoll.OnRequest) (e error)
	SetReadTimeoutFunc   func(timeout time.Duration) (e error)
}
func (m *MockNetpollConn) AddCloseCallback(c netpoll.CloseCallback) (e error) {
	if m.AddCloseCallbackFunc != nil {
		return m.AddCloseCallbackFunc(c)
	}
	return
}
func (m *MockNetpollConn) IsActive() (r bool) {
	if m.IsActiveFunc != nil {
		return m.IsActiveFunc()
	}
	return
}
func (m *MockNetpollConn) Reader() (r netpoll.Reader) {
	if m.ReaderFunc != nil {
		return m.ReaderFunc()
	}
	return
}