package instancectl import ( "context" "net" "net/http" ) type requestConnKey struct{} func RequestConn(ctx context.Context) net.Conn { c, _ := ctx.Value(requestConnKey{}).(net.Conn) return c } func requestConnContext(ctx context.Context, c net.Conn) context.Context { return context.WithValue(ctx, requestConnKey{}, c) } // RunWithClaim serves the claim verbs through handler and, when // heldRelease is not nil, the moves held-release route through it (the // host passes it only with both flags on; nil leaves the route absent). func RunWithClaim(args []string, handler, heldRelease http.Handler, hostApp func(string) (string, string, error)) { runWithClaim(args, handler, heldRelease, hostApp) }