Documentation
¶
Index ¶
- type TestServer
- func (s *TestServer) GetReceivedMetadata() []metadata.MD
- func (s *TestServer) SayHello(ctx context.Context, in *test_server.HelloRequest) (*test_server.HelloReply, error)
- func (s *TestServer) SayHelloBidi(...) error
- func (s *TestServer) SayHelloHowAreYou(in *test_server.HelloRequest, ...) error
- func (s *TestServer) SayMultipleHellos(stream test_server.Greeter_SayMultipleHellosServer) error
- func (s *TestServer) Stop()
- type TestServerOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TestServer ¶
type TestServer struct {
test_server.UnimplementedGreeterServer
OAuthAddress string
Mu sync.Mutex
SayHelloInvocations int
SayMultiHellosInvocations int
SayHelloHowAreYouInvocations int
SayHelloBidiInvocations int
Port int
// contains filtered or unexported fields
}
func StartGRPCServer ¶
func StartGRPCServer(t *testing.T, opts ...TestServerOpt) *TestServer
func (*TestServer) GetReceivedMetadata ¶
func (s *TestServer) GetReceivedMetadata() []metadata.MD
func (*TestServer) SayHello ¶
func (s *TestServer) SayHello(ctx context.Context, in *test_server.HelloRequest) (*test_server.HelloReply, error)
func (*TestServer) SayHelloBidi ¶
func (s *TestServer) SayHelloBidi(stream grpc.BidiStreamingServer[test_server.HelloRequest, test_server.HelloReply]) error
func (*TestServer) SayHelloHowAreYou ¶
func (s *TestServer) SayHelloHowAreYou(in *test_server.HelloRequest, stream test_server.Greeter_SayHelloHowAreYouServer) error
func (*TestServer) SayMultipleHellos ¶
func (s *TestServer) SayMultipleHellos(stream test_server.Greeter_SayMultipleHellosServer) error
func (*TestServer) Stop ¶
func (s *TestServer) Stop()
type TestServerOpt ¶
type TestServerOpt func(*TestServer)
func WithHealthCheck ¶
func WithHealthCheck() TestServerOpt
func WithOAuth2 ¶
func WithOAuth2() TestServerOpt
func WithReflection ¶
func WithReflection() TestServerOpt
func WithReturnErrors ¶
func WithReturnErrors() TestServerOpt
func WithTLS ¶
func WithTLS() TestServerOpt
Click to show internal directories.
Click to hide internal directories.