grpcutil

package
v1.0.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToOutgoingContext

func AppendToOutgoingContext(ctx context.Context, src []*conformancev1.Header) context.Context

AppendToOutgoingContext appends the given headers to the outgoing context. Used for sending metadata from the client side.

func ConvertGrpcToProtoError

func ConvertGrpcToProtoError(err error) *conformancev1.Error

ConvertGrpcToProtoError converts the given gRPC error to a proto Error message. If err is nil, the function will also return nil.

func ConvertMetadataToProtoHeader

func ConvertMetadataToProtoHeader(
	src metadata.MD,
) []*conformancev1.Header

ConvertMetadataToProtoHeader converts gRPC metadata into proto Headers.

func ConvertProtoHeaderToMetadata

func ConvertProtoHeaderToMetadata(
	src []*conformancev1.Header,
) metadata.MD

ConvertProtoHeaderToMetadata converts a slice of proto Headers into gRPC metadata.

func ConvertProtoToGrpcError

func ConvertProtoToGrpcError(err *conformancev1.Error) error

ConvertProtoToGrpcError converts a proto Error into a gRPC error.

func PercentEncodeMessage added in v1.0.1

func PercentEncodeMessage(msg string) string

PercentEncodeMessage percent-encodes the given string per the rules in the gRPC spec for the "grpc-message" trailer value.

func ShouldEscapeByteInMessage added in v1.0.1

func ShouldEscapeByteInMessage(char byte) bool

ShouldEscapeByteInMessage returns true if the given byte should be percent-escaped when written in the value of a "grpc-message" response trailer.

Types

This section is empty.

Jump to

Keyboard shortcuts

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