grpcx

package
v1.42.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const ServiceNameKey = "x-nitric-service-name"

Variables

This section is empty.

Functions

func CreateServiceNameInterceptor

func CreateServiceNameInterceptor(serviceName string) (grpc.UnaryServerInterceptor, grpc.StreamServerInterceptor)

func GetServiceNameFromIncomingContext

func GetServiceNameFromIncomingContext(ctx context.Context) (string, error)

GetServiceNameFromIncomingContext extracts the nitric service name from the incoming context of a grpc request

func GetServiceNameFromStream

func GetServiceNameFromStream(stream grpc.ServerStream) (string, error)

GetServiceNameFromStream extracts the nitric service name from the incoming context of a grpc stream

Types

type GrpcBidiStreamServer

type GrpcBidiStreamServer[ServerMessage any, ClientMessage any] interface {
	Send(ServerMessage) error
	Recv() (ClientMessage, error)
	grpc.ServerStream
}

type PeekableStreamServer

type PeekableStreamServer[ServerMessage any, ClientMessage any] struct {
	GrpcBidiStreamServer[ServerMessage, ClientMessage]
	// contains filtered or unexported fields
}

func NewPeekableStreamServer

func NewPeekableStreamServer[ServerMessage any, ClientMessage any](stream GrpcBidiStreamServer[ServerMessage, ClientMessage]) *PeekableStreamServer[ServerMessage, ClientMessage]

func (*PeekableStreamServer[ServerMessage, ClientMessage]) Peek

func (s *PeekableStreamServer[ServerMessage, ClientMessage]) Peek() (ClientMessage, error)

func (*PeekableStreamServer[ServerMessage, ClientMessage]) Recv

func (s *PeekableStreamServer[ServerMessage, ClientMessage]) Recv() (ClientMessage, error)

Jump to

Keyboard shortcuts

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