grpcutil

package
v4.3.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package grpcutil implements some common functionality for gRPC that we use across all servers.

Index

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 NewServer

func NewServer(keyFile, certFile string) *grpc.Server

NewServer creates a new gRPC server with a standard set of interceptors.

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.

Jump to

Keyboard shortcuts

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