Documentation
¶
Overview ¶
Package rpc is a generated GoMock package.
Index ¶
- Variables
- func EncodeMsg(data []byte) []byte
- func InitClientProxy(network, address string, service Service) error
- func ReadMsg(conn net.Conn) ([]byte, error)
- type Client
- type GetByIDReq
- type GetByIDResp
- type MockProxy
- type MockProxyMockRecorder
- type Proxy
- type Request
- type Response
- type Server
- type Service
- type UserService
- type UserServiceServer
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrServiceNil = errors.New("rpc: nil service is not supported") ErrServiceWrongType = errors.New("rpc: only first-level pointer to struct is supported") )
Functions ¶
func InitClientProxy ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
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(arg0, arg1 interface{}) *gomock.Call
Invoke indicates an expected call of Invoke.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RegisterService ¶
type UserService ¶
type UserService struct {
GetByID func(ctx context.Context, req *GetByIDReq) (*GetByIDResp, error)
}
func (UserService) Name ¶
func (s UserService) Name() string
type UserServiceServer ¶
type UserServiceServer struct { }
func (*UserServiceServer) GetByID ¶
func (s *UserServiceServer) GetByID(ctx context.Context, req *GetByIDReq) (*GetByIDResp, error)
func (*UserServiceServer) Name ¶
func (s *UserServiceServer) Name() string
Click to show internal directories.
Click to hide internal directories.