Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registrant ¶
type Registrant interface { // GRPCTestRegister registers gRPC server implementation on passed server. GRPCTestRegister(*grpc.Server) }
Registrant should be implemented by generated gRPC mocks.
type Server ¶
type Server struct { Listener net.Listener Server *grpc.Server // contains filtered or unexported fields }
func NewServer ¶
func NewServer(opts ...grpc.ServerOption) *Server
func (*Server) Serve ¶
func (s *Server) Serve(regs ...Registrant) *Server
Serve registers passed registerers and starts serving. Example: instance := &computemocks.InstanceServer{} instance.On("Get", mock.Anything, mock.Anything).Return(
func(context.Context, *compute.GetInstanceRequest) (*compute.Instance, error) { return &compute.Instance{}, nil })
server := NewServer().Serve(instance) defer server.Close()
Click to show internal directories.
Click to hide internal directories.