Documentation
¶
Overview ¶
Package mrpc is a generated GoMock package.
Index ¶
- func CtxWithOneway(ctx context.Context) context.Context
- func ReadMsg(conn net.Conn) ([]byte, error)
- type Client
- type ClientOption
- type GetByIdReq
- type GetByIdResp
- type MockProxy
- type MockProxyMockRecorder
- type MockService
- type MockServiceMockRecorder
- type Proxy
- type Server
- type Service
- type UserService
- type UserServiceServer
- type UserServiceServerTimeout
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) InitService ¶
InitService 为GetById之类的函数类型字段赋值
type ClientOption ¶
type ClientOption func(client *Client)
func ClientWithSerializer ¶
func ClientWithSerializer(sl serialize.Serializer) ClientOption
type GetByIdReq ¶
type GetByIdReq struct {
Id int
}
type GetByIdResp ¶
type GetByIdResp struct {
Msg string
}
type MockProxy ¶
type MockProxy struct {
// contains filtered or unexported fields
}
MockProxy is a mock of Proxy interface.
func NewMockProxy ¶
func NewMockProxy(ctrl *gomock.Controller) *MockProxy
NewMockProxy creates a new mock instance.
func (*MockProxy) EXPECT ¶
func (m *MockProxy) EXPECT() *MockProxyMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockProxyMockRecorder ¶
type MockProxyMockRecorder struct {
// contains filtered or unexported fields
}
MockProxyMockRecorder is the mock recorder for MockProxy.
func (*MockProxyMockRecorder) Invoke ¶
func (mr *MockProxyMockRecorder) Invoke(ctx, req interface{}) *gomock.Call
Invoke indicates an expected call of Invoke.
type MockService ¶
type MockService struct {
// contains filtered or unexported fields
}
MockService is a mock of Service interface.
func NewMockService ¶
func NewMockService(ctrl *gomock.Controller) *MockService
NewMockService creates a new mock instance.
func (*MockService) EXPECT ¶
func (m *MockService) EXPECT() *MockServiceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockServiceMockRecorder ¶
type MockServiceMockRecorder struct {
// contains filtered or unexported fields
}
MockServiceMockRecorder is the mock recorder for MockService.
func (*MockServiceMockRecorder) Name ¶
func (mr *MockServiceMockRecorder) Name() *gomock.Call
Name indicates an expected call of Name.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RegisterSerializer ¶
func (s *Server) RegisterSerializer(sl serialize.Serializer)
func (*Server) RegisterService ¶
type UserService ¶
type UserService struct {
GetById func(ctx context.Context, req *GetByIdReq) (*GetByIdResp, error) // 一个GetById方法
GetByIdProto func(ctx context.Context, req *gen.GetByIdReq) (*gen.GetByIdResp, error)
}
func (UserService) Name ¶
func (u UserService) Name() string
type UserServiceServer ¶
func (*UserServiceServer) GetById ¶
func (u *UserServiceServer) GetById(ctx context.Context, req *GetByIdReq) (*GetByIdResp, error)
func (*UserServiceServer) GetByIdProto ¶
func (u *UserServiceServer) GetByIdProto(ctx context.Context, req *gen.GetByIdReq) (*gen.GetByIdResp, error)
func (*UserServiceServer) Name ¶
func (u *UserServiceServer) Name() string
type UserServiceServerTimeout ¶
type UserServiceServerTimeout struct {
Err error
Msg string
// contains filtered or unexported fields
}
func (*UserServiceServerTimeout) GetById ¶
func (u *UserServiceServerTimeout) GetById(ctx context.Context, req *GetByIdReq) (*GetByIdResp, error)
func (*UserServiceServerTimeout) Name ¶
func (u *UserServiceServerTimeout) Name() string
Source Files
¶
Click to show internal directories.
Click to hide internal directories.