mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: github.com/moby/buildkit 25bec7145b39 (v0.14.0-dev)
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
8
vendor/github.com/moby/buildkit/client/connhelper/npipe/npipe.go
generated
vendored
Normal file
8
vendor/github.com/moby/buildkit/client/connhelper/npipe/npipe.go
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
// Package npipe provides connhelper for npipe://<address>
|
||||
package npipe
|
||||
|
||||
import "github.com/moby/buildkit/client/connhelper"
|
||||
|
||||
func init() {
|
||||
connhelper.Register("npipe", Helper)
|
||||
}
|
14
vendor/github.com/moby/buildkit/client/connhelper/npipe/npipe_other.go
generated
vendored
Normal file
14
vendor/github.com/moby/buildkit/client/connhelper/npipe/npipe_other.go
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
//go:build !windows
|
||||
|
||||
package npipe
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"net/url"
|
||||
|
||||
"github.com/moby/buildkit/client/connhelper"
|
||||
)
|
||||
|
||||
func Helper(u *url.URL) (*connhelper.ConnectionHelper, error) {
|
||||
return nil, errors.New("npipe connections are only supported on windows")
|
||||
}
|
28
vendor/github.com/moby/buildkit/client/connhelper/npipe/npipe_windows.go
generated
vendored
Normal file
28
vendor/github.com/moby/buildkit/client/connhelper/npipe/npipe_windows.go
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
//go:build windows
|
||||
|
||||
package npipe
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"github.com/Microsoft/go-winio"
|
||||
"github.com/moby/buildkit/client/connhelper"
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Helper returns helper for connecting to a url via npipes.
|
||||
func Helper(u *url.URL) (*connhelper.ConnectionHelper, error) {
|
||||
addrParts := strings.SplitN(u.String(), "://", 2)
|
||||
if len(addrParts) != 2 {
|
||||
return nil, errors.Errorf("invalid address %s", u)
|
||||
}
|
||||
address := strings.Replace(addrParts[1], "/", "\\", -1)
|
||||
return &connhelper.ConnectionHelper{
|
||||
ContextDialer: func(ctx context.Context, addr string) (net.Conn, error) {
|
||||
return winio.DialPipeContext(ctx, address)
|
||||
},
|
||||
}, nil
|
||||
}
|
Reference in New Issue
Block a user