Documentation ¶
Index ¶
- Constants
- type InterceptorTestSuite
- func (s *InterceptorTestSuite) DeadlineCtx(deadline time.Time) context.Context
- func (s *InterceptorTestSuite) NewClient(dialOpts ...grpc.DialOption) testpb.TestServiceClient
- func (s *InterceptorTestSuite) RestartServer(delayedStart time.Duration) <-chan bool
- func (s *InterceptorTestSuite) ServerAddr() string
- func (s *InterceptorTestSuite) SetupSuite()
- func (s *InterceptorTestSuite) SimpleCtx() context.Context
- func (s *InterceptorTestSuite) TearDownSuite()
- type MutexReadWriter
- type TestPingService
- func (s *TestPingService) Ping(_ context.Context, ping *testpb.PingRequest) (*testpb.PingResponse, error)
- func (s *TestPingService) PingEmpty(_ context.Context, _ *testpb.Empty) (*testpb.PingResponse, error)
- func (s *TestPingService) PingError(_ context.Context, ping *testpb.PingRequest) (*testpb.Empty, error)
- func (s *TestPingService) PingList(ping *testpb.PingRequest, stream testpb.TestService_PingListServer) error
- func (s *TestPingService) PingStream(stream testpb.TestService_PingStreamServer) error
Constants ¶
View Source
const ( // DefaultPongValue is the default value used. DefaultResponseValue = "default_response_value" // ListResponseCount is the expected number of responses to PingList. ListResponseCount = 100 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InterceptorTestSuite ¶
type InterceptorTestSuite struct { suite.Suite TestService testpb.TestServiceServer ServerOpts []grpc.ServerOption ClientOpts []grpc.DialOption ServerListener net.Listener Server *grpc.Server Client testpb.TestServiceClient // contains filtered or unexported fields }
InterceptorTestSuite is a testify/Suite that starts a gRPC PingService server and a client.
func (*InterceptorTestSuite) DeadlineCtx ¶
func (s *InterceptorTestSuite) DeadlineCtx(deadline time.Time) context.Context
func (*InterceptorTestSuite) NewClient ¶
func (s *InterceptorTestSuite) NewClient(dialOpts ...grpc.DialOption) testpb.TestServiceClient
func (*InterceptorTestSuite) RestartServer ¶
func (s *InterceptorTestSuite) RestartServer(delayedStart time.Duration) <-chan bool
func (*InterceptorTestSuite) ServerAddr ¶
func (s *InterceptorTestSuite) ServerAddr() string
func (*InterceptorTestSuite) SetupSuite ¶
func (s *InterceptorTestSuite) SetupSuite()
func (*InterceptorTestSuite) SimpleCtx ¶
func (s *InterceptorTestSuite) SimpleCtx() context.Context
func (*InterceptorTestSuite) TearDownSuite ¶
func (s *InterceptorTestSuite) TearDownSuite()
type MutexReadWriter ¶
MutexReadWriter is a io.ReadWriter that can be read and worked on from multiple go routines.
func NewMutexReadWriter ¶
func NewMutexReadWriter(rw io.ReadWriter) *MutexReadWriter
NewMutexReadWriter creates a new thread-safe io.ReadWriter.
type TestPingService ¶
func (*TestPingService) Ping ¶
func (s *TestPingService) Ping(_ context.Context, ping *testpb.PingRequest) (*testpb.PingResponse, error)
func (*TestPingService) PingEmpty ¶
func (s *TestPingService) PingEmpty(_ context.Context, _ *testpb.Empty) (*testpb.PingResponse, error)
func (*TestPingService) PingError ¶
func (s *TestPingService) PingError(_ context.Context, ping *testpb.PingRequest) (*testpb.Empty, error)
func (*TestPingService) PingList ¶
func (s *TestPingService) PingList(ping *testpb.PingRequest, stream testpb.TestService_PingListServer) error
func (*TestPingService) PingStream ¶
func (s *TestPingService) PingStream(stream testpb.TestService_PingStreamServer) error
Click to show internal directories.
Click to hide internal directories.