mockpb

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockStatusServer

type MockStatusServer struct {
	pb.StatusServer

	Reqs []proto.Message

	// If set, all calls return this error.
	Err error

	// responses to return if err == nil
	Resps []proto.Message
	Index int
}

MockStatusServer for testing

func (*MockStatusServer) Server

func (*MockStatusServer) SetResponse

func (m *MockStatusServer) SetResponse(r proto.Message)

SetResponse sets a single response without errors

func (*MockStatusServer) SetResponses

func (m *MockStatusServer) SetResponses(r []proto.Message)

SetResponses sets responses without errors

func (*MockStatusServer) Version

func (m *MockStatusServer) Version(ctx context.Context, req *emptypb.Empty) (*pb.ServerVersion, error)

Jump to

Keyboard shortcuts

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