grpc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SocketPath                   = "/tmp/daemons.sock"
	UserReadWriteOnlyPermissions = os.FileMode(0600)
	DefaultPermissions           = os.FileMode(0x180)
)

Variables

View Source
var (
	Ctx      = context.TODO()
	TcpConn  = &grpc.ClientConn{}
	GrpcConn = (*grpc.ClientConn)(nil)
)
View Source
var (
	TcpEndpoint = "localhost:9090"
)

Functions

func GenerateMockGrpcClientWithOptionalGrpcConnectionErrors

func GenerateMockGrpcClientWithOptionalGrpcConnectionErrors(
	connectionErr error,
	closeErr error,
	closeConnectionIsCalled bool,
) *mocks.GrpcClient

GenerateMockGrpcClientWithOptionalGrpcConnectionErrors generates a mock gRPC client that mocks both Tcp and Grpc connections and optionally returns the specified errors on Grpc connections.

func GenerateMockGrpcClientWithOptionalTcpConnectionErrors

func GenerateMockGrpcClientWithOptionalTcpConnectionErrors(
	connectionErr error,
	closeErr error,
	closeConnectionIsCalled bool,
) *mocks.GrpcClient

GenerateMockGrpcClientWithOptionalTcpConnectionErrors generates a mock gRPC client that mocks Tcp connections and optionally returns the given connection and close errors. This mock also mocks grpc connections if the tcp connection is expected to be closed.

Types

type QueryClient

QueryClient combines all the query clients used in testing into a single mock interface for testing convenience.

type QueryServer

type QueryServer interface {
	pricetypes.QueryServer
}

Jump to

Keyboard shortcuts

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