mock

package
v0.0.0-...-be15534 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewExecutorClient

func NewExecutorClient(conn Conn) pb.ExecutorServiceClient

NewExecutorClient returns executor client based on Conn

func NewTestClient

func NewTestClient(conn Conn) pb.TestServiceClient

NewTestClient creates a mock test service client

func ResetGrpcCtx

func ResetGrpcCtx()

ResetGrpcCtx resets grpc servers

Types

type Conn

type Conn interface {
	Close() error
	// contains filtered or unexported methods
}

Conn is a simple interface that support send gRPC requests and closeable

func Dial

func Dial(addr string) (Conn, error)

Dial dials to gRPC server

type GrpcServer

type GrpcServer interface {
	Stop()
	// contains filtered or unexported methods
}

GrpcServer implements a mock grpc server.

func NewExecutorServer

func NewExecutorServer(addr string, server pb.ExecutorServiceServer) (GrpcServer, error)

NewExecutorServer returns a mock executor gRPC server for given address, if it doesn't exist, create a new one

func NewMasterServer

func NewMasterServer(addr string, server masterServices) (GrpcServer, error)

NewMasterServer creates a master grpc server and listened the address. We try to make things simple, so we design the "NewMasterServer" to register only one type of pb server.

func NewTestServer

func NewTestServer(addr string, server pb.TestServiceServer) (GrpcServer, error)

NewTestServer creates a mock gRPC server

Jump to

Keyboard shortcuts

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