mocker

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockingInterceptor

func MockingInterceptor(filePath string) grpc.UnaryClientInterceptor

func WithMaxDelay added in v0.0.6

func WithMaxDelay(maxDelay time.Duration) option

func WithMinDelay added in v0.0.6

func WithMinDelay(minDelay time.Duration) option

Types

type Config

type Config struct {
	Request  map[string]interface{} `json:"request,omitempty"`
	Response map[string]interface{} `json:"response,omitempty"`
	Service  string                 `json:"service"`
	Method   string                 `json:"method"`
	Error    string                 `json:"error"`
	Ignore   []string               `json:"ignore"`
}

type MockClient

type MockClient interface {
	grpc.ClientConnInterface
}

type MockServer

type MockServer interface {
	Serve(ctx context.Context, svc, method string, request []byte) ([]byte, error)
}

type Mocker

type Mocker interface {
	MockServer
	MockClient
}

func NewMocker

func NewMocker(filePath string, opts ...option) (Mocker, error)

Jump to

Keyboard shortcuts

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