transport

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConnType = fmt.Errorf("connection must be of type QuicConn")

ErrInvalidConnType is returned when a connection is not of type QuicConn.

Functions

func New

func New(listener *quic.Listener) net.Listener

New

func NewCredentials

func NewCredentials(tlsConfig *tls.Config) credentials.TransportCredentials

Create new credentials object from tls config

func NewQuicConn

func NewQuicConn(connection *quic.Conn) (net.Conn, error)

NewQuicConn creates a new QuicConn with an open QUIC stream

func NewQuicDialer

func NewQuicDialer(tlsConfig *tls.Config) func(context.Context, string) (net.Conn, error)

NewQuicDialer returns a new Quic Dialer function

Types

type Credentials

type Credentials struct {
	// contains filtered or unexported fields
}

Credentials for gRPC over QUIC https://pkg.go.dev/google.golang.org/grpc@v1.42.0/credentials#TransportCredentials

func (*Credentials) ClientHandshake

func (creds *Credentials) ClientHandshake(ctx context.Context, authority string, conn net.Conn) (net.Conn, credentials.AuthInfo, error)

QUIC gRPC implementation of ClientHandshake

ClientHandshake handles the client-side authentication handshake for the specified authentication protocol. ClientHandshake returns an authenicated connection and relevant authentication information.

Read more here: https://pkg.go.dev/google.golang.org/grpc@v1.42.0/credentials#TransportCredentials

func (*Credentials) Clone

Clone makes a copy of Credentials

func (*Credentials) Info

func (creds *Credentials) Info() credentials.ProtocolInfo

Info provides ProtocolInfo of Credentials

func (*Credentials) OverrideServerName deprecated

func (creds *Credentials) OverrideServerName(name string) error

QUIC gRPC facade for OverrideServerName

Deprecated: use grpc.WithAuthority instead.

func (*Credentials) ServerHandshake

func (creds *Credentials) ServerHandshake(conn net.Conn) (net.Conn, credentials.AuthInfo, error)

QUIC gRPC implementation of ServerHandshake

ServerHandshake handles the server-side authentication handshake for the specified authentication protocol. ServerHandshake returns an authenicated connection and relevant authentication information.

Read more here: https://pkg.go.dev/google.golang.org/grpc@v1.42.0/credentials#TransportCredentials

type QuicConn

type QuicConn struct {
	// contains filtered or unexported fields
}

QuicConn implements net.Conn using a QUIC connection and stream

func (*QuicConn) Close

func (qc *QuicConn) Close() error

Close closes both the QUIC stream and connection

func (*QuicConn) LocalAddr

func (qc *QuicConn) LocalAddr() net.Addr

LocalAddr returns the local network address of the QUIC connection

func (*QuicConn) Read

func (qc *QuicConn) Read(b []byte) (int, error)

Read reads data from the QUIC stream. Returns the number of bytes read and any error encountered

func (*QuicConn) RemoteAddr

func (qc *QuicConn) RemoteAddr() net.Addr

RemoteAddr returns the remote network address of the QUIC connection

func (*QuicConn) SetDeadline

func (qc *QuicConn) SetDeadline(t time.Time) error

SetDeadline sets the read and write deadlines for the QUIC stream

func (*QuicConn) SetReadDeadline

func (qc *QuicConn) SetReadDeadline(t time.Time) error

SetReadDeadline sets the deadline for future Read calls on the QUIC stream

func (*QuicConn) SetWriteDeadline

func (qc *QuicConn) SetWriteDeadline(t time.Time) error

SetWriteDeadline sets the deadline for future Write calls on the QUIC stream

func (*QuicConn) Write

func (qc *QuicConn) Write(b []byte) (int, error)

Write writes data to the QUIC stream. Returns the number of bytes written and any error encountered

Jump to

Keyboard shortcuts

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