grpchelper

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

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.

Index

Constants

View Source
const (
	StartKeepalivesAfterInactivityDuration = 5 * time.Second
	KeepalivePeerTimeout                   = 10 * time.Second
)

The following constants are relevant for interoperability. We use the same values for client & server, because zrepl is more symmetrical ("one source, one sink") instead of the typical gRPC scenario ("many clients, single server")

Variables

This section is empty.

Functions

func ClientConn

func ClientConn(cn transport.Connecter, log Logger) *grpc.ClientConn

ClientConn is an easy-to-use wrapper around the Dialer and TransportCredentials interface to produce a grpc.ClientConn

func NewServer

func NewServer(authListener transport.AuthenticatedListener, clientIdentityKey interface{}, logger grpcclientidentity.Logger, ctxInterceptor grpcclientidentity.Interceptor) (srv *grpc.Server, serve func() error)

NewServer is a convenience interface around the TransportCredentials and Interceptors interface.

Types

type Logger

type Logger = logger.Logger

Jump to

Keyboard shortcuts

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