middleware

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2020 License: MIT Imports: 7 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 LogOutgoingStreamRequest

func LogOutgoingStreamRequest(logger *log.Logger) 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(logger *log.Logger) 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(logger *log.Logger) 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(logger *log.Logger) 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{})

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