grpcclientidentity

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package grpcclientidentity makes the client identity provided by github.com/zrepl/zrepl/daemon/transport/serve.{AuthenticatedListener,AuthConn} available to gRPC service handlers.

This goal is achieved through the combination of custom gRPC transport credentials and two interceptors (i.e. middleware).

For gRPC clients, the TransportCredentials + Dialer can be used to construct a gRPC client (grpc.ClientConn) that uses a github.com/zrepl/zrepl/daemon/transport/connect.Connecter to connect to a server.

The adaptors exposed by this package must be used together, and panic if they are not. See package grpchelper for a more restrictive but safe example on how the adaptors should be composed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInterceptors

func NewInterceptors(logger Logger, clientIdentityKey interface{}) (unary grpc.UnaryServerInterceptor, stream grpc.StreamServerInterceptor)

func NewTransportCredentials

func NewTransportCredentials(log Logger) credentials.TransportCredentials

Use on both sides as ServerOption or ClientOption.

Types

type GRPCDialFunction

type GRPCDialFunction = func(string, time.Duration) (net.Conn, error)

func NewDialer

func NewDialer(logger Logger, connecter transport.Connecter) GRPCDialFunction

type Logger

type Logger = logger.Logger

Directories

Path Synopsis
This package demonstrates how the grpcclientidentity package can be used to set up a gRPC greeter service.
This package demonstrates how the grpcclientidentity package can be used to set up a gRPC greeter service.
pdu
Package grpchelper wraps the adaptors implemented by package grpcclientidentity into a less flexible API which, however, ensures that the individual adaptor primitive's expectations are met and hence do not panic.
Package grpchelper wraps the adaptors implemented by package grpcclientidentity into a less flexible API which, however, ensures that the individual adaptor primitive's expectations are met and hence do not panic.

Jump to

Keyboard shortcuts

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