mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
vendor: update buildkit
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
18
vendor/github.com/moby/buildkit/client/client.go
generated
vendored
18
vendor/github.com/moby/buildkit/client/client.go
generated
vendored
@ -29,7 +29,8 @@ import (
|
||||
)
|
||||
|
||||
type Client struct {
|
||||
conn *grpc.ClientConn
|
||||
conn *grpc.ClientConn
|
||||
sessionDialer func(ctx context.Context, proto string, meta map[string][]string) (net.Conn, error)
|
||||
}
|
||||
|
||||
type ClientOpt interface{}
|
||||
@ -49,6 +50,7 @@ func New(ctx context.Context, address string, opts ...ClientOpt) (*Client, error
|
||||
var customTracer bool // allows manually setting disabling tracing even if tracer in context
|
||||
var tracerProvider trace.TracerProvider
|
||||
var tracerDelegate TracerDelegate
|
||||
var sessionDialer func(context.Context, string, map[string][]string) (net.Conn, error)
|
||||
|
||||
for _, o := range opts {
|
||||
if _, ok := o.(*withFailFast); ok {
|
||||
@ -73,6 +75,9 @@ func New(ctx context.Context, address string, opts ...ClientOpt) (*Client, error
|
||||
if wt, ok := o.(*withTracerDelegate); ok {
|
||||
tracerDelegate = wt
|
||||
}
|
||||
if sd, ok := o.(*withSessionDialer); ok {
|
||||
sessionDialer = sd.dialer
|
||||
}
|
||||
}
|
||||
|
||||
if !customTracer {
|
||||
@ -131,7 +136,8 @@ func New(ctx context.Context, address string, opts ...ClientOpt) (*Client, error
|
||||
}
|
||||
|
||||
c := &Client{
|
||||
conn: conn,
|
||||
conn: conn,
|
||||
sessionDialer: sessionDialer,
|
||||
}
|
||||
|
||||
if tracerDelegate != nil {
|
||||
@ -244,6 +250,14 @@ type withTracerDelegate struct {
|
||||
TracerDelegate
|
||||
}
|
||||
|
||||
func WithSessionDialer(dialer func(context.Context, string, map[string][]string) (net.Conn, error)) ClientOpt {
|
||||
return &withSessionDialer{dialer}
|
||||
}
|
||||
|
||||
type withSessionDialer struct {
|
||||
dialer func(context.Context, string, map[string][]string) (net.Conn, error)
|
||||
}
|
||||
|
||||
func resolveDialer(address string) (func(context.Context, string) (net.Conn, error), error) {
|
||||
ch, err := connhelper.GetConnectionHelper(address)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user