Help us shape the future of Go! Take the 2026 Go Developer Survey

testutil

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package testutil provides testing utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockClientConn

type MockClientConn struct {
	grpc.ClientConnInterface
	// contains filtered or unexported fields
}

MockClientConn is a mock implementation of grpc.ClientConnInterface for testing.

func NewMockClientConn

func NewMockClientConn(t *testing.T) *MockClientConn

NewMockClientConn creates a new mock client connection.

func (*MockClientConn) Invoke

func (m *MockClientConn) Invoke(_ context.Context, _ string, _ interface{}, _ interface{}, _ ...grpc.CallOption) error

Invoke is a mock implementation of the Invoke method.

func (*MockClientConn) NewStream

func (m *MockClientConn) NewStream(_ context.Context, _ *grpc.StreamDesc, method string, _ ...grpc.CallOption) (grpc.ClientStream, error)

NewStream is a mock implementation of the NewStream method.

func (*MockClientConn) SetClient

func (m *MockClientConn) SetClient(method string, client interface{})

SetClient sets a mock client for a given type.

Jump to

Keyboard shortcuts

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