Documentation ¶
Overview ¶
Package grpcutil implements some common functionality for gRPC that we use across all servers.
Index ¶
- func LogStreamRequests(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, ...) error
- func LogUnaryRequests(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, ...) (interface{}, error)
- func NewServer(keyFile, certFile string) *grpc.Server
- func OptionalTLS(keyFile, certFile string, opts ...grpc.ServerOption) []grpc.ServerOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LogStreamRequests ¶
func LogStreamRequests(srv interface{}, ss grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error
LogStreamRequests is a gRPC interceptor that logs outcomes of stream requests.
func LogUnaryRequests ¶
func LogUnaryRequests(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error)
LogUnaryRequests is a gRPC interceptor that logs outcomes of unary requests.
func OptionalTLS ¶
func OptionalTLS(keyFile, certFile string, opts ...grpc.ServerOption) []grpc.ServerOption
OptionalTLS loads TLS certificates from the given files and attaches them as a gRPC ServerOption. If both filenames are empty then no credentials will be attached.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.