grpc

package
Version: v0.17.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package grpc provides mock for grpc types.

Index

Constants

This section is empty.

Variables

View Source
var NoMockClientStream = MockClientStream()

NoMockClientStream is no mock ClientStream.

View Source
var NoMockServerStream = MockServerStream()

NoMockServerStream is no mock ServerStream.

Functions

This section is empty.

Types

type ClientStream

type ClientStream struct {
	mock.Mock
}

ClientStream is a grpc.ClientStream.

func (*ClientStream) CloseSend

func (c *ClientStream) CloseSend() error

CloseSend satisfies grpc.ClientStream.

func (*ClientStream) Context

func (c *ClientStream) Context() context.Context

Context satisfies grpc.ClientStream.

func (*ClientStream) Header

func (c *ClientStream) Header() (metadata.MD, error)

Header satisfies grpc.ClientStream.

func (*ClientStream) RecvMsg

func (c *ClientStream) RecvMsg(m interface{}) error

RecvMsg satisfies grpc.ClientStream.

func (*ClientStream) SendMsg

func (c *ClientStream) SendMsg(m interface{}) error

SendMsg satisfies grpc.ClientStream.

func (*ClientStream) Trailer

func (c *ClientStream) Trailer() metadata.MD

Trailer satisfies grpc.ClientStream.

type ClientStreamMocker

type ClientStreamMocker func(tb testing.TB) *ClientStream

ClientStreamMocker is ClientStream mocker.

func MockClientStream

func MockClientStream(mocks ...func(s *ClientStream)) ClientStreamMocker

MockClientStream creates ClientStream mock with cleanup to ensure all the expectations are met.

type ServerStream

type ServerStream struct {
	mock.Mock
}

ServerStream is a grpc.ServerStream.

func (*ServerStream) Context

func (s *ServerStream) Context() context.Context

Context satisfies grpc.ServerStream.

func (*ServerStream) RecvMsg

func (s *ServerStream) RecvMsg(m interface{}) error

RecvMsg satisfies grpc.ServerStream.

func (*ServerStream) SendHeader

func (s *ServerStream) SendHeader(md metadata.MD) error

SendHeader satisfies grpc.ServerStream.

func (*ServerStream) SendMsg

func (s *ServerStream) SendMsg(m interface{}) error

SendMsg satisfies grpc.ServerStream.

func (*ServerStream) SetHeader

func (s *ServerStream) SetHeader(md metadata.MD) error

SetHeader satisfies grpc.ServerStream.

func (*ServerStream) SetTrailer

func (s *ServerStream) SetTrailer(md metadata.MD)

SetTrailer satisfies grpc.ServerStream.

type ServerStreamMocker

type ServerStreamMocker func(tb testing.TB) *ServerStream

ServerStreamMocker is ServerStream mocker.

func MockServerStream

func MockServerStream(mocks ...func(s *ServerStream)) ServerStreamMocker

MockServerStream creates ServerStream mock with cleanup to ensure all the expectations are met.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL