internal

package
v0.0.0-...-e246948 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conf *zrpc.RpcClientConf) (zrpc.Client, error)

func SetMethod2CliAtomic

func SetMethod2CliAtomic(mp map[string]zrpc.Client)

func TransparentHandler

func TransparentHandler(director func(ctx context.Context, fullMethodName string) (grpc.ClientConnInterface, error),
	match func(ctx context.Context, req match.Request) (*match.Response, error)) grpc.StreamHandler

TransparentHandler returns a handler that attempts to proxy all requests that are not registered in the server. The indented use here is as a transparent proxy, where the server doesn't know about the services implemented by the backends. It should be used as a `grpc.UnknownServiceHandler`.

This can *only* be used if the `server` also uses grpcproxy.CodecForServer() ServerOption.

Types

type Config

type Config struct {
	MockEnableKey     string `json:",default=mock"`
	MockEnableValue   string `json:",default=yes"`
	MockDisableValue  string `json:",default=no"`
	MockCaseKey       string `json:",default=case_name"`
	MockCustomCaseKey string `json:",default=custom_case"`
}

type ReqMeta

type ReqMeta struct {
	FullMethodName string
	TestedAppName  string
	MD             metadata.MD
}

type StreamDirector

type StreamDirector func(ctx context.Context, fullMethodName string) (context.Context, grpc.ClientConnInterface, func(), error)

func GetStreamDirector

func GetStreamDirector() StreamDirector

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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