client

package
v0.19.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2025 License: Apache-2.0 Imports: 77 Imported by: 2

Documentation

Index

Constants

View Source
const InstrumentationLibrary = "dagger.io/engine.client"
View Source
const StableIDFileName = "stable_client_id"

Variables

This section is empty.

Functions

func GetHostStableID added in v0.12.3

func GetHostStableID(lg *slog.Logger) string

GetHostStableID returns a random ID that's persisted in the caller's XDG state directory. It's currently used to identify clients that are executing on the same host in order to tell buildkit which filesync cache ref to re-use when syncing dirs+files to the engine.

func Tracer added in v0.11.0

func Tracer(ctx context.Context) trace.Tracer

Types

type AuthProxy added in v0.19.7

type AuthProxy struct {
	// contains filtered or unexported fields
}

func NewAuthProxy added in v0.19.7

func NewAuthProxy(client auth.AuthClient) AuthProxy

func (AuthProxy) Credentials added in v0.19.7

func (AuthProxy) FetchToken added in v0.19.7

func (AuthProxy) GetTokenAuthority added in v0.19.7

func (AuthProxy) Register added in v0.19.7

func (p AuthProxy) Register(server *grpc.Server)

func (AuthProxy) VerifyTokenAuthority added in v0.19.7

type BuildkitSessionServer added in v0.11.8

type BuildkitSessionServer struct {
	*grpc.Server
	MethodURLs  []string
	Conn        net.Conn
	Attachables []bksession.Attachable
}

func ConnectBuildkitSession added in v0.11.8

func ConnectBuildkitSession(
	ctx context.Context,
	conn net.Conn,
	headers http.Header,
	attachables ...bksession.Attachable,
) (*BuildkitSessionServer, error)

func NewBuildkitSessionServer added in v0.11.8

func NewBuildkitSessionServer(ctx context.Context, conn net.Conn, attachables ...bksession.Attachable) *BuildkitSessionServer

func (*BuildkitSessionServer) Run added in v0.11.8

func (srv *BuildkitSessionServer) Run(ctx context.Context)

type Client

type Client struct {
	Params
	// contains filtered or unexported fields
}

func Connect

func Connect(ctx context.Context, params Params) (_ *Client, rerr error)

func ConnectEngineToEngine added in v0.19.7

func ConnectEngineToEngine(ctx context.Context, params EngineToEngineParams) (_ *Client, rerr error)

ConnectEngineToEngine connects a Dagger client to another Dagger engine using an existing session connection. Session attachables are proxied back to the original client.

func (*Client) AppendHTTPRequestHeaders added in v0.11.8

func (c *Client) AppendHTTPRequestHeaders(headers http.Header) http.Header

func (*Client) Close

func (c *Client) Close() (rerr error)

func (*Client) Dagger added in v0.8.8

func (c *Client) Dagger() *dagger.Client

A client to the Dagger API hooked up directly with this engine client.

func (*Client) DialContext

func (c *Client) DialContext(ctx context.Context, _, _ string) (conn net.Conn, err error)

func (*Client) Do

func (c *Client) Do(
	ctx context.Context,
	query string,
	opName string,
	variables map[string]any,
	data any,
) (rerr error)

func (*Client) ServeHTTP

func (c *Client) ServeHTTP(w http.ResponseWriter, r *http.Request)

type DirectConn added in v0.8.8

type DirectConn func(*http.Request) (*http.Response, error)

func EngineConn added in v0.8.8

func EngineConn(engineClient *Client) DirectConn

func (DirectConn) Close added in v0.8.8

func (f DirectConn) Close() error

func (DirectConn) Do added in v0.8.8

func (f DirectConn) Do(r *http.Request) (*http.Response, error)

func (DirectConn) Host added in v0.8.8

func (f DirectConn) Host() string

type EngineToEngineParams added in v0.19.7

type EngineToEngineParams struct {
	Params

	// The caller's session grpc conn, which will be proxied back to
	CallerSessionConn *grpc.ClientConn

	// important we forward the original client's stable id so that filesync
	// caching can work as expected
	StableClientID string

	Labels enginetel.Labels
}

type FilesyncSource added in v0.11.5

type FilesyncSource Filesyncer

func (FilesyncSource) DiffCopy added in v0.11.5

func (FilesyncSource) Register added in v0.11.5

func (s FilesyncSource) Register(server *grpc.Server)

func (FilesyncSource) TarStream added in v0.11.5

type FilesyncSourceProxy added in v0.19.7

type FilesyncSourceProxy struct {
	Client filesync.FileSyncClient
}

func (FilesyncSourceProxy) DiffCopy added in v0.19.7

func (FilesyncSourceProxy) Register added in v0.19.7

func (s FilesyncSourceProxy) Register(server *grpc.Server)

func (FilesyncSourceProxy) TarStream added in v0.19.7

type FilesyncTarget added in v0.11.5

type FilesyncTarget Filesyncer

func (FilesyncTarget) DiffCopy added in v0.11.5

func (t FilesyncTarget) DiffCopy(stream filesync.FileSend_DiffCopyServer) (rerr error)

func (FilesyncTarget) Register added in v0.11.5

func (t FilesyncTarget) Register(server *grpc.Server)

type FilesyncTargetProxy added in v0.19.7

type FilesyncTargetProxy struct {
	Client filesync.FileSendClient
}

func (FilesyncTargetProxy) DiffCopy added in v0.19.7

func (FilesyncTargetProxy) Register added in v0.19.7

func (s FilesyncTargetProxy) Register(server *grpc.Server)

type Filesyncer added in v0.11.5

type Filesyncer struct {
	// contains filtered or unexported fields
}

func NewFilesyncer added in v0.11.5

func NewFilesyncer() (Filesyncer, error)

func (Filesyncer) AsSource added in v0.11.5

func (f Filesyncer) AsSource() FilesyncSource

func (Filesyncer) AsTarget added in v0.11.5

func (f Filesyncer) AsTarget() FilesyncTarget

type Params

type Params struct {
	// The id to connect to the API server with. If blank, will be set to a
	// new random value.
	ID string

	// The id of the session to connect to, or if blank a new one should be started.
	SessionID string

	Version string

	SecretToken string

	RunnerHost string // host of dagger engine runner serving buildkit apis

	DisableHostRW bool

	CloudURLCallback func(context.Context, string, string, bool)

	EngineTrace   sdktrace.SpanExporter
	EngineLogs    sdklog.Exporter
	EngineMetrics []sdkmetric.Exporter

	// Log level (0 = INFO)
	LogLevel slog.Level

	Interactive        bool
	InteractiveCommand []string

	WithTerminal terminal.WithTerminalFunc

	AllowedLLMModules []string

	PromptHandler prompt.PromptHandler

	Stdin  io.Reader
	Stdout io.Writer

	ImageLoaderBackend imageload.Backend

	Module   string
	Function string
	ExecCmd  []string

	EagerRuntime bool

	CloudBasicAuthToken string
	EnableCloudScaleOut bool
}

type SocketProvider

type SocketProvider struct {
	EnableHostNetworkAccess bool
}

func (SocketProvider) CheckAgent

func (SocketProvider) ForwardAgent

func (p SocketProvider) ForwardAgent(stream sshforward.SSH_ForwardAgentServer) error

func (SocketProvider) Register

func (p SocketProvider) Register(server *grpc.Server)

type SocketSessionProxy added in v0.19.7

type SocketSessionProxy struct {
	// contains filtered or unexported fields
}

SocketSessionProxy is a proxy of a the grpc session attachable (as opposed to the above socketProxy which proxies to arbitrary net.Conns). It's used for engine scale-out.

func NewSocketSessionProxy added in v0.19.7

func NewSocketSessionProxy(client sshforward.SSHClient) *SocketSessionProxy

func (*SocketSessionProxy) CheckAgent added in v0.19.7

func (*SocketSessionProxy) ForwardAgent added in v0.19.7

func (*SocketSessionProxy) Register added in v0.19.7

func (p *SocketSessionProxy) Register(server *grpc.Server)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL