Documentation ¶
Index ¶
- Variables
- func Listen(ql quic.Listener) net.Listener
- func NewCredentials(tlsConfig *tls.Config) credentials.TransportCredentials
- func NewQuicConn(connection quic.Connection) (net.Conn, error)
- func NewQuicDialer(tlsConfig *tls.Config) func(context.Context, string) (net.Conn, error)
- type Credentials
- func (creds *Credentials) ClientHandshake(ctx context.Context, authority string, conn net.Conn) (net.Conn, credentials.AuthInfo, error)
- func (creds *Credentials) Clone() credentials.TransportCredentials
- func (creds *Credentials) Info() credentials.ProtocolInfo
- func (creds *Credentials) OverrideServerName(name string) errordeprecated
- func (creds *Credentials) ServerHandshake(conn net.Conn) (net.Conn, credentials.AuthInfo, error)
- type QuicConn
- func (qc *QuicConn) Close() error
- func (qc *QuicConn) LocalAddr() net.Addr
- func (qc *QuicConn) Read(b []byte) (int, error)
- func (qc *QuicConn) RemoteAddr() net.Addr
- func (qc *QuicConn) SetDeadline(t time.Time) error
- func (qc *QuicConn) SetReadDeadline(t time.Time) error
- func (qc *QuicConn) SetWriteDeadline(t time.Time) error
- func (qc *QuicConn) Write(b []byte) (int, error)
- type QuicListener
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidConnType = fmt.Errorf("connection must be of type QuicConn")
ErrInvalidConnType is returned when a connection is not of type QuicConn.
Functions ¶
func NewCredentials ¶
func NewCredentials(tlsConfig *tls.Config) credentials.TransportCredentials
Create new credentials object from tls config
func NewQuicConn ¶
NewQuicConn creates a new QuicConn with an open QUIC stream
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 ¶
func (creds *Credentials) Clone() credentials.TransportCredentials
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) Read ¶
Read reads data from the QUIC stream. Returns the number of bytes read and any error encountered
func (*QuicConn) RemoteAddr ¶
RemoteAddr returns the remote network address of the QUIC connection
func (*QuicConn) SetDeadline ¶
SetDeadline sets the read and write deadlines for the QUIC stream
func (*QuicConn) SetReadDeadline ¶
SetReadDeadline sets the deadline for future Read calls on the QUIC stream
func (*QuicConn) SetWriteDeadline ¶
SetWriteDeadline sets the deadline for future Write calls on the QUIC stream
type QuicListener ¶
type QuicListener struct {
// contains filtered or unexported fields
}
func (*QuicListener) Accept ¶
func (ql *QuicListener) Accept() (net.Conn, error)
Accept waits for and returns the next connection to the listener
func (*QuicListener) Addr ¶
func (ql *QuicListener) Addr() net.Addr
Addr returns the listeners network address