grpcutil

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 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 []*v1.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) *v1.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,
) []*v1.Header

ConvertMetadataToProtoHeader converts gRPC metadata into proto Headers.

func ConvertProtoHeaderToMetadata

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

ConvertProtoHeaderToMetadata converts a slice of proto Headers into gRPC metadata.

func ConvertProtoToGrpcError

func ConvertProtoToGrpcError(err *v1.Error) error

ConvertProtoToGrpcError converts a proto Error into a gRPC error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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