grpcext

package
v0.2.2 Latest Latest
Warning

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

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

Documentation

Overview

Package grpcext allows gRPC requests collecting stats info.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DebugStat

func DebugStat(logger logrus.FieldLogger, stat grpcstats.RPCStats, httpDebugOption string)

DebugStat prints debugging information based on RPCStats.

func DefaultOptions

func DefaultOptions(vu modules.VU) []grpc.DialOption

DefaultOptions generates an option set with common options for requests from a VU.

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn is a gRPC client connection.

func Dial

func Dial(ctx context.Context, addr string, options ...grpc.DialOption) (*Conn, error)

Dial establish a gRPC connection.

func (*Conn) Close

func (c *Conn) Close() error

Close closes the underhood connection.

func (*Conn) Invoke

func (c *Conn) Invoke(
	ctx context.Context,
	url string,
	md metadata.MD,
	req Request,
	opts ...grpc.CallOption,
) (*Response, error)

Invoke executes a unary gRPC request.

func (*Conn) Reflect

Reflect returns using the reflection the FileDescriptorSet describing the service.

type Request

type Request struct {
	MethodDescriptor protoreflect.MethodDescriptor
	Tags             map[string]string
	Message          []byte
}

Request represents a gRPC request.

type Response

type Response struct {
	Message  interface{}
	Error    interface{}
	Headers  map[string][]string
	Trailers map[string][]string
	Status   codes.Code
}

Response represents a gRPC response.

Jump to

Keyboard shortcuts

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