grpc

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2022 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RetryProfile = []grpc.CallOption{
	RetryOption,
}

RetryProfile is the common retry profile for RPCs.

Functions

func LogIDClientInterceptor

func LogIDClientInterceptor() grpc.UnaryClientInterceptor

func LogIDClientStreamInterceptor added in v0.7.0

func LogIDClientStreamInterceptor() grpc.StreamClientInterceptor

func LogIDServerInterceptor

func LogIDServerInterceptor() grpc.UnaryServerInterceptor

func LogIDServerStreamInterceptor added in v0.7.0

func LogIDServerStreamInterceptor() grpc.StreamServerInterceptor

func StreamClientInterceptor added in v0.7.0

func StreamClientInterceptor() grpc.DialOption

StreamClientInterceptor constructs the default stream RPC client-side interceptor for SCION control-plane applications.

func StreamServerInterceptor added in v0.7.0

func StreamServerInterceptor() grpc.ServerOption

StreamServerInterceptor constructs the default stream RPC server-side interceptor for SCION control-plane applications.

func UnaryClientInterceptor

func UnaryClientInterceptor() grpc.DialOption

UnaryClientInterceptor constructs the default unary RPC client-side interceptor for SCION control-plane applications.

func UnaryServerInterceptor

func UnaryServerInterceptor() grpc.ServerOption

UnaryServerInterceptor constructs the default unary RPC server-side interceptor for SCION control-plane applications.

Types

type AddressRewriter

type AddressRewriter interface {
	RedirectToQUIC(ctx context.Context, address net.Addr) (net.Addr, bool, error)
}

AddressRewriter redirects to QUIC endpoints.

type ConnDialer

type ConnDialer interface {
	Dial(context.Context, net.Addr) (net.Conn, error)
}

ConnDialer dials a net.Conn.

type Dialer

type Dialer interface {
	// DialContext creates a client connection to the given target.
	Dial(context.Context, net.Addr) (*grpc.ClientConn, error)
}

Dialer creates a gRPC client connection to the given target.

type QUICDialer

type QUICDialer struct {
	Rewriter AddressRewriter
	Dialer   ConnDialer
}

QUICDialer dials a gRPC connection over QUIC/SCION. This dialer is meant to be used for inter AS communication, and is capable of resolving svc addresses.

func (*QUICDialer) Dial

func (d *QUICDialer) Dial(ctx context.Context, addr net.Addr) (*grpc.ClientConn, error)

Dial dials a gRPC connection over QUIC/SCION.

type SimpleDialer

type SimpleDialer struct{}

SimpleDialer implements a wrapper around grpc.DialContext that implements the dialer interface. It simply uses the string of the address to dial.

func (SimpleDialer) Dial

func (SimpleDialer) Dial(ctx context.Context, address net.Addr) (*grpc.ClientConn, error)

Dial dials the address by converting it to a string.

type TCPDialer

type TCPDialer struct {
	SvcResolver func(addr.HostSVC) []resolver.Address
}

TCPDialer dials a gRPC connection over TCP. This dialer is meant to be used for AS internal communication, and is capable of resolving svc addresses.

func (*TCPDialer) Dial

func (t *TCPDialer) Dial(ctx context.Context, dst net.Addr) (*grpc.ClientConn, error)

Dial dials a gRPC connection over TCP. It resolves svc addresses.

type TLSQUICDialer

type TLSQUICDialer struct {
	*QUICDialer
	Credentials credentials.TransportCredentials
}

TLSQUICDialer dials a gRPC connection over TLS/QUIC/SCION. This dialer is meant to be used for secure inter AS communication.

func (*TLSQUICDialer) Dial

func (d *TLSQUICDialer) Dial(ctx context.Context, addr net.Addr) (*grpc.ClientConn, error)

Dial dials a gRPC connection over TLS/QUIC/SCION.

Jump to

Keyboard shortcuts

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