utils

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMockClient

func CreateMockClient(jsonBody string) *http.Client

func MetadataInterceptor

func MetadataInterceptor(t *testing.T, expectedMetadata map[string]string) grpc.UnaryClientInterceptor

MetadataInterceptor is a grpc.UnaryClientInterceptor that extracts the gRPC metadata from the outgoing RPC request context so we can assert on it

Types

type MockTransport

type MockTransport struct {
	Req  *http.Request
	Resp *http.Response
	Err  error
}

func (*MockTransport) RoundTrip

func (m *MockTransport) RoundTrip(req *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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