middleware

package
v0.0.1-0...-6deec57 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendMetadataToOutgoingStreamContext

func AppendMetadataToOutgoingStreamContext() grpc.StreamClientInterceptor

AppendMetadataToOutgoingStreamContext appends metadata to outgoing context

https://godoc.org/google.golang.org/grpc#WithStreamInterceptor

conn, err := grpc.Dial("localhost:5000", grpc.WithStreamInterceptor(AppendMetadataToOutgoingStreamContext()))

func AppendMetadataToOutgoingUnaryContext

func AppendMetadataToOutgoingUnaryContext() grpc.UnaryClientInterceptor

AppendMetadataToOutgoingUnaryContext appends metadata to outgoing context

https://godoc.org/google.golang.org/grpc#WithUnaryInterceptor

conn, err := grpc.Dial("localhost:5000", grpc.WithUnaryInterceptor(AppendMetadataToOutgoingUnaryContext()))

func CountIncomingStreamRequests

func CountIncomingStreamRequests() grpc.StreamServerInterceptor

func CountIncomingUnaryRequests

func CountIncomingUnaryRequests() grpc.UnaryServerInterceptor

func LogOutgoingStreamRequest

func LogOutgoingStreamRequest() grpc.StreamClientInterceptor

LogOutgoingStreamRequest logs client request

https://godoc.org/google.golang.org/grpc#WithStreamInterceptor

conn, err := grpc.Dial("localhost:5000", grpc.WithStreamInterceptor(LogOutgoingStreamRequest()))

func LogOutgoingUnaryRequest

func LogOutgoingUnaryRequest() grpc.UnaryClientInterceptor

LogOutgoingUnaryRequest logs client request

https://godoc.org/google.golang.org/grpc#WithUnaryInterceptor

conn, err := grpc.Dial("localhost:5000", grpc.WithUnaryInterceptor(LogOutgoingUnaryRequest()))

func LogStreamRequest

func LogStreamRequest() grpc.StreamServerInterceptor

LogStreamRequest returns error if Identity not set within context or user does not have required role

https://godoc.org/google.golang.org/grpc#StreamInterceptor
opts := []grpc.ServerOption{
	grpc.UnaryInterceptor(LogStreamRequest(logger)),
}

s := grpc.NewServer(opts...) pb.LogStreamRequest(s, &server{})

func LogUnaryRequest

func LogUnaryRequest() grpc.UnaryServerInterceptor

LogUnaryRequest returns error if Identity not set within context or user does not have required role

https://godoc.org/google.golang.org/grpc#UnaryInterceptor
opts := []grpc.ServerOption{
	grpc.UnaryInterceptor(LogUnaryRequest(logger)),
}

s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{})

func SetMetadataFromStreamRequest

func SetMetadataFromStreamRequest() grpc.StreamServerInterceptor

SetMetadataFromStreamRequest updates context with metadata

https://godoc.org/google.golang.org/grpc#StreamInterceptor
opts := []grpc.ServerOption{
	grpc.UnaryInterceptor(SetMetadataFromStreamRequest()),
}

s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{})

func SetMetadataFromUnaryRequest

func SetMetadataFromUnaryRequest() grpc.UnaryServerInterceptor

SetMetadataFromUnaryRequest updates context with metadata

https://godoc.org/google.golang.org/grpc#UnaryInterceptor
opts := []grpc.ServerOption{
	grpc.UnaryInterceptor(SetMetadataFromUnaryRequest()),
}

s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{})

func TransformStreamIncomingError

func TransformStreamIncomingError() grpc.StreamClientInterceptor

TransformStreamIncomingError transforms outgoing apperrors to appropriate status codes

https://godoc.org/google.golang.org/grpc#WithStreamInterceptor

conn, err := grpc.Dial("localhost:5000", grpc.WithStreamInterceptor(TransformStreamIncomingError()))

func TransformStreamOutgoingError

func TransformStreamOutgoingError() grpc.StreamServerInterceptor

TransformStreamOutgoingError transforms incoming error into app error

https://godoc.org/google.golang.org/grpc#StreamInterceptor
opts := []grpc.ServerOption{
	grpc.UnaryInterceptor(TransformStreamOutgoingError()),
}

s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{})

func TransformUnaryIncomingError

func TransformUnaryIncomingError() grpc.UnaryClientInterceptor

TransformUnaryIncomingError transforms outgoing apperrors to appropriate status codes

https://godoc.org/google.golang.org/grpc#WithUnaryInterceptor

conn, err := grpc.Dial("localhost:5000", grpc.WithUnaryInterceptor(TransformUnaryIncomingError()))

func TransformUnaryOutgoingError

func TransformUnaryOutgoingError() grpc.UnaryServerInterceptor

TransformUnaryOutgoingError transforms incoming error into app error

https://godoc.org/google.golang.org/grpc#UnaryInterceptor
opts := []grpc.ServerOption{
	grpc.UnaryInterceptor(TransformUnaryOutgoingError()),
}

s := grpc.NewServer(opts...) pb.RegisterGreeterServer(s, &server{})

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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