Documentation ¶
Overview ¶
Package drpcmigrate provides tools to support drpc concurrently alongside gRPC on the same ports. See the grpc_and_drpc example in the examples folder for expected usage.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Closed = errs.New("listener closed")
Closed is returned by routed listeners when the mux is closed.
var DRPCHeader = "DRPC!!!1"
DRPCHeader is a header for DRPC connections to use. This is designed to not conflict with a headerless gRPC, HTTP, or TLS request.
Functions ¶
Types ¶
type HeaderConn ¶
HeaderConn fulfills the net.Conn interface. On the first call to Write it will write the Header.
func NewHeaderConn ¶
func NewHeaderConn(conn net.Conn, header string) *HeaderConn
NewHeaderConn returns a new *HeaderConn that writes the provided header as part of the first Write.
type HeaderDialer ¶
HeaderDialer is a net.Dialer-like that prefixes all conns with the provided header.
func (*HeaderDialer) Dial ¶
func (d *HeaderDialer) Dial(network, address string) (net.Conn, error)
Dial will dial the address on the named network, creating a connection that will write the configured Header on the first user-requested write.
func (*HeaderDialer) DialContext ¶
DialContext will dial the address on the named network, creating a connection that will write the configured Header on the first user-requested write.
type ListenMux ¶
type ListenMux struct {
// contains filtered or unexported fields
}
ListenMux lets one multiplex a listener into different listeners based on the first bytes sent on the connection.
func NewListenMux ¶
NewListenMux creates a ListenMux that reads the prefixLen bytes from any connections Accepted by the passed in listener and dispatches to the appropriate route.