grpchelper

package
v0.8.4 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 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

View Source
var CallTimeout = time.Minute

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.

func WithTimeout added in v0.7.4

func WithTimeout(t time.Duration, log Logger) grpc.UnaryClientInterceptor

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