mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
6fcb36ff14
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
14 lines
357 B
Go
14 lines
357 B
Go
package grpchijack
|
|
|
|
import (
|
|
"net"
|
|
|
|
controlapi "github.com/moby/buildkit/api/services/control"
|
|
"google.golang.org/grpc/metadata"
|
|
)
|
|
|
|
func Hijack(stream controlapi.Control_SessionServer) (net.Conn, <-chan struct{}, map[string][]string) {
|
|
md, _ := metadata.FromIncomingContext(stream.Context())
|
|
c, closeCh := streamToConn(stream)
|
|
return c, closeCh, md
|
|
}
|