test

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnaryInfo = &grpc.UnaryServerInfo{
		FullMethod: "TestService.UnaryMethod",
	}

	StreamInfo = &grpc.StreamServerInfo{
		FullMethod:     "TestService.StreamMethod",
		IsClientStream: false,
		IsServerStream: true,
	}
)

Functions

func RequestIDContext

func RequestIDContext(t *testing.T) context.Context

Types

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(output any, err error) *Handler

func (*Handler) Stream

func (h *Handler) Stream(srv any, stream grpc.ServerStream) error

func (*Handler) Unary

func (h *Handler) Unary(ctx context.Context, req any) (any, error)

type TestServerStream

type TestServerStream struct {
	grpc.ServerStream
	// contains filtered or unexported fields
}

func ServerStream

func ServerStream(ctx context.Context) *TestServerStream

func (*TestServerStream) Context

func (ts *TestServerStream) Context() context.Context

func (*TestServerStream) Method

func (ts *TestServerStream) Method() string

func (*TestServerStream) RecvMsg

func (ts *TestServerStream) RecvMsg(m any) error

func (*TestServerStream) SendMsg

func (ts *TestServerStream) SendMsg(m any) error

type TestServerTransportStream

type TestServerTransportStream struct {
	// contains filtered or unexported fields
}

func ServerTransportStream

func ServerTransportStream(method string) *TestServerTransportStream

func (*TestServerTransportStream) Method

func (ts *TestServerTransportStream) Method() string

func (*TestServerTransportStream) SendHeader

func (ts *TestServerTransportStream) SendHeader(md metadata.MD) error

func (*TestServerTransportStream) SetHeader

func (ts *TestServerTransportStream) SetHeader(md metadata.MD) error

func (*TestServerTransportStream) SetTrailer

func (ts *TestServerTransportStream) SetTrailer(md metadata.MD) error

Jump to

Keyboard shortcuts

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