go-api-boilerplate: github.com/vardius/go-api-boilerplate/pkg/grpc/middleware Index | Files | Directories

package middleware

import "github.com/vardius/go-api-boilerplate/pkg/grpc/middleware"

Index

Package Files

logger.go metadata.go

func AppendMetadataToOutgoingStreamContext Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

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{})

Directories

PathSynopsis
firewall

Package middleware imports 7 packages (graph) and is imported by 1 packages. Updated 2020-07-15. Refresh now. Tools for package owners.