Versions in this module Expand all Collapse all v0 v0.6.1 Jul 31, 2023 v0.0.4 Jul 31, 2023 Changes in this version + const MockErrorMethod + const MockExceptionMethod + const MockMethod + const MockOnewayMethod + const MockServiceName + func MockFuncHandler(mf func(ctx context.Context, req *MyRequest) (r *MyResponse, err error)) interface + func MyServiceHandler() interface + func NewMockArgs() interface + func NewMockCliTransHandlerFactory(hdrl *MockCliTransHandler) remote.ClientTransHandlerFactory + func NewMockResult() interface + func NewMockSvrTransHandlerFactory(hdrl *MockSvrTransHandler) remote.ServerTransHandlerFactory + func NewMockTransServerFactory(transSvr *MockTransServer) remote.TransServerFactory + func ServiceInfo() *serviceinfo.ServiceInfo + type Conn struct + CloseFunc func() (e error) + LocalAddrFunc func() (r net.Addr) + ReadFunc func(b []byte) (n int, err error) + RemoteAddrFunc func() (r net.Addr) + SetDeadlineFunc func(t time.Time) (e error) + SetReadDeadlineFunc func(t time.Time) (e error) + SetWriteDeadlineFunc func(t time.Time) (e error) + WriteFunc func(b []byte) (n int, err error) + func (m Conn) Close() (e error) + func (m Conn) LocalAddr() (r net.Addr) + func (m Conn) Read(b []byte) (n int, err error) + func (m Conn) RemoteAddr() (r net.Addr) + func (m Conn) SetDeadline(t time.Time) (e error) + func (m Conn) SetReadDeadline(t time.Time) (e error) + func (m Conn) SetWriteDeadline(t time.Time) (e error) + func (m Conn) Write(b []byte) (n int, err error) + type MockCliTransHandler struct + OnMessageFunc func(ctx context.Context, args, result remote.Message) (context.Context, error) + ReadFunc func(ctx context.Context, conn net.Conn, msg remote.Message) (nctx context.Context, err error) + WriteFunc func(ctx context.Context, conn net.Conn, send remote.Message) (nctx context.Context, err error) + func (t *MockCliTransHandler) OnActive(ctx context.Context, conn net.Conn) (context.Context, error) + func (t *MockCliTransHandler) OnError(ctx context.Context, err error, conn net.Conn) + func (t *MockCliTransHandler) OnInactive(ctx context.Context, conn net.Conn) + func (t *MockCliTransHandler) OnMessage(ctx context.Context, args, result remote.Message) (context.Context, error) + func (t *MockCliTransHandler) Read(ctx context.Context, conn net.Conn, msg remote.Message) (nctx context.Context, err error) + func (t *MockCliTransHandler) SetPipeline(p *remote.TransPipeline) + func (t *MockCliTransHandler) Write(ctx context.Context, conn net.Conn, send remote.Message) (nctx context.Context, err error) + type MockSvrTransHandler struct + OnReadFunc func(ctx context.Context, conn net.Conn) error + Opt *remote.ServerOption + ReadFunc func(ctx context.Context, conn net.Conn, msg remote.Message) (nctx context.Context, err error) + WriteFunc func(ctx context.Context, conn net.Conn, send remote.Message) (nctx context.Context, err error) + func (t *MockSvrTransHandler) OnActive(ctx context.Context, conn net.Conn) (context.Context, error) + func (t *MockSvrTransHandler) OnError(ctx context.Context, err error, conn net.Conn) + func (t *MockSvrTransHandler) OnInactive(ctx context.Context, conn net.Conn) + func (t *MockSvrTransHandler) OnMessage(ctx context.Context, args, result remote.Message) (context.Context, error) + func (t *MockSvrTransHandler) OnRead(ctx context.Context, conn net.Conn) (err error) + func (t *MockSvrTransHandler) Read(ctx context.Context, conn net.Conn, msg remote.Message) (nctx context.Context, err error) + func (t *MockSvrTransHandler) SetPipeline(p *remote.TransPipeline) + func (t *MockSvrTransHandler) Write(ctx context.Context, conn net.Conn, send remote.Message) (nctx context.Context, err error) + type MockThriftTTransport struct + FlushFunc func(ctx context.Context) (err error) + ReadBinaryFunc func() (value []byte, err error) + ReadBoolFunc func() (value bool, err error) + ReadByteFunc func() (value int8, err error) + ReadDoubleFunc func() (value float64, err error) + ReadFieldBeginFunc func() (name string, typeID thrift.TType, id int16, err error) + ReadFieldEndFunc func() error + ReadI16Func func() (value int16, err error) + ReadI32Func func() (value int32, err error) + ReadI64Func func() (value int64, err error) + ReadListBeginFunc func() (elemType thrift.TType, size int, err error) + ReadListEndFunc func() error + ReadMapBeginFunc func() (keyType, valueType thrift.TType, size int, err error) + ReadMapEndFunc func() error + ReadMessageBeginFunc func() (name string, typeID thrift.TMessageType, seqID int32, err error) + ReadMessageEndFunc func() error + ReadSetBeginFunc func() (elemType thrift.TType, size int, err error) + ReadSetEndFunc func() error + ReadStringFunc func() (value string, err error) + ReadStructBeginFunc func() (name string, err error) + ReadStructEndFunc func() error + SkipFunc func(fieldType thrift.TType) (err error) + TransportFunc func() thrift.TTransport + WriteBinaryFunc func(value []byte) error + WriteBoolFunc func(value bool) error + WriteByteFunc func(value int8) error + WriteDoubleFunc func(value float64) error + WriteFieldBeginFunc func(name string, typeID thrift.TType, id int16) error + WriteFieldEndFunc func() error + WriteFieldStopFunc func() error + WriteI16Func func(value int16) error + WriteI32Func func(value int32) error + WriteI64Func func(value int64) error + WriteListBeginFunc func(elemType thrift.TType, size int) error + WriteListEndFunc func() error + WriteMapBeginFunc func(keyType, valueType thrift.TType, size int) error + WriteMapEndFunc func() error + WriteMessageBeginFunc func(name string, typeID thrift.TMessageType, seqID int32) error + WriteMessageEndFunc func() error + WriteSetBeginFunc func(elemType thrift.TType, size int) error + WriteSetEndFunc func() error + WriteStringFunc func(value string) error + WriteStructBeginFunc func(name string) error + WriteStructEndFunc func() error + func (m *MockThriftTTransport) Flush(ctx context.Context) (err error) + func (m *MockThriftTTransport) ReadBinary() (value []byte, err error) + func (m *MockThriftTTransport) ReadBool() (value bool, err error) + func (m *MockThriftTTransport) ReadByte() (value int8, err error) + func (m *MockThriftTTransport) ReadDouble() (value float64, err error) + func (m *MockThriftTTransport) ReadFieldBegin() (name string, typeID thrift.TType, id int16, err error) + func (m *MockThriftTTransport) ReadFieldEnd() error + func (m *MockThriftTTransport) ReadI16() (value int16, err error) + func (m *MockThriftTTransport) ReadI32() (value int32, err error) + func (m *MockThriftTTransport) ReadI64() (value int64, err error) + func (m *MockThriftTTransport) ReadListBegin() (elemType thrift.TType, size int, err error) + func (m *MockThriftTTransport) ReadListEnd() error + func (m *MockThriftTTransport) ReadMapBegin() (keyType, valueType thrift.TType, size int, err error) + func (m *MockThriftTTransport) ReadMapEnd() error + func (m *MockThriftTTransport) ReadMessageBegin() (name string, typeID thrift.TMessageType, seqID int32, err error) + func (m *MockThriftTTransport) ReadMessageEnd() error + func (m *MockThriftTTransport) ReadSetBegin() (elemType thrift.TType, size int, err error) + func (m *MockThriftTTransport) ReadSetEnd() error + func (m *MockThriftTTransport) ReadString() (value string, err error) + func (m *MockThriftTTransport) ReadStructBegin() (name string, err error) + func (m *MockThriftTTransport) ReadStructEnd() error + func (m *MockThriftTTransport) Skip(fieldType thrift.TType) (err error) + func (m *MockThriftTTransport) Transport() thrift.TTransport + func (m *MockThriftTTransport) WriteBinary(value []byte) error + func (m *MockThriftTTransport) WriteBool(value bool) error + func (m *MockThriftTTransport) WriteByte(value int8) error + func (m *MockThriftTTransport) WriteDouble(value float64) error + func (m *MockThriftTTransport) WriteFieldBegin(name string, typeID thrift.TType, id int16) error + func (m *MockThriftTTransport) WriteFieldEnd() error + func (m *MockThriftTTransport) WriteFieldStop() error + func (m *MockThriftTTransport) WriteI16(value int16) error + func (m *MockThriftTTransport) WriteI32(value int32) error + func (m *MockThriftTTransport) WriteI64(value int64) error + func (m *MockThriftTTransport) WriteListBegin(elemType thrift.TType, size int) error + func (m *MockThriftTTransport) WriteListEnd() error + func (m *MockThriftTTransport) WriteMapBegin(keyType, valueType thrift.TType, size int) error + func (m *MockThriftTTransport) WriteMapEnd() error + func (m *MockThriftTTransport) WriteMessageBegin(name string, typeID thrift.TMessageType, seqID int32) error + func (m *MockThriftTTransport) WriteMessageEnd() error + func (m *MockThriftTTransport) WriteSetBegin(elemType thrift.TType, size int) error + func (m *MockThriftTTransport) WriteSetEnd() error + func (m *MockThriftTTransport) WriteString(value string) error + func (m *MockThriftTTransport) WriteStructBegin(name string) error + func (m *MockThriftTTransport) WriteStructEnd() error + type MockTransServer struct + BootstrapServerFunc func(net.Listener) (err error) + ConnCountFunc func() utils.AtomicInt + CreateListenerFunc func(net.Addr) (net.Listener, error) + ShutdownFunc func() (err error) + func (t *MockTransServer) BootstrapServer(ln net.Listener) (err error) + func (t *MockTransServer) ConnCount() (r utils.AtomicInt) + func (t *MockTransServer) CreateListener(addr net.Addr) (ln net.Listener, err error) + func (t *MockTransServer) Shutdown() (err error) + type MockTransServerFactory struct + func (t *MockTransServerFactory) NewTransServer(opt *remote.ServerOption, transHdlr remote.ServerTransHandler) remote.TransServer + type MyException struct + Message string + func (p *MyException) Error() string + type MyRequest struct + Name string + type MyResponse struct + Name string + type MyService interface + Mock func(ctx context.Context, req *MyRequest) (r *MyResponse, err error) + MockError func(ctx context.Context, req *MyRequest) (r *MyResponse, err error) + MockException func(ctx context.Context, req *MyRequest) (r *MyResponse, err error) + MockOneway func(ctx context.Context, req *MyRequest) (err error)