Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handshaker ¶
type Handshaker interface { // Handshake is called with a valid Conn and AuthInfo when grpc-go // accepts a connection that presents the Magic() magic bytes. From the // point of view of grpc-go, it is part of the // credentials.TransportCredentials.ServerHandshake callback. The return // values of Handshake become the return values of // credentials.TransportCredentials.ServerHandshake. Handshake(net.Conn, credentials.AuthInfo) (net.Conn, credentials.AuthInfo, error) // Magic returns the magic bytes that clients must send on the wire to // reach this handshaker. The string must be no more than 11 bytes long. // If it is longer, this handshaker will never be called. Magic() string }
Handshaker represents a multiplexed connection type.
type Mux ¶
type Mux struct { credentials.TransportCredentials // contains filtered or unexported fields }
Mux is a listener multiplexer that plugs into grpc-go as a "TransportCredentials" callback.
func New ¶
func New(tc credentials.TransportCredentials) *Mux
New returns a *Mux that wraps existing transport credentials. This does nothing interesting unless you also call Register to add handshakers to the Mux.
func (*Mux) Register ¶
func (m *Mux) Register(h Handshaker)
Register registers a handshaker. It is not thread-safe.
func (*Mux) ServerHandshake ¶
ServerHandshake peeks the connection to determine whether the client wants to make a multiplexed connection. It is part of the TransportCredentials interface.
Click to show internal directories.
Click to hide internal directories.