buildkit/session/grpchijack/hijack.go

14 lines
306 B
Go
Raw Normal View History

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, map[string][]string) {
md, _ := metadata.FromContext(stream.Context())
return streamToConn(stream), md
}