Documentation
¶
Index ¶
- Constants
- func Abs(path string) (string, error)
- func ExpandHomeDir(homeDir string, path string) (string, error)
- func GetDrive(path string) string
- func GetHostStableID(lg *slog.Logger) string
- func Getwd() (string, error)
- func LexicalRelativePath(cwdPath, modPath string) (string, error)
- func Tracer(ctx context.Context) trace.Tracer
- type BuildkitSessionServer
- type Client
- func (c *Client) AppendHTTPRequestHeaders(headers http.Header) http.Header
- func (c *Client) Close() (rerr error)
- func (c *Client) Dagger() *dagger.Client
- func (c *Client) DialContext(ctx context.Context, _, _ string) (conn net.Conn, err error)
- func (c *Client) Do(ctx context.Context, query string, opName string, variables map[string]any, ...) (rerr error)
- func (c *Client) ServeHTTP(w http.ResponseWriter, r *http.Request)
- type DirectConn
- type FilesyncSource
- type FilesyncTarget
- type Filesyncer
- type Params
- type SocketProvider
Constants ¶
const InstrumentationLibrary = "dagger.io/engine.client"
const StableIDFileName = "stable_client_id"
Variables ¶
This section is empty.
Functions ¶
func Abs ¶ added in v0.15.0
Abs returns an absolute representation of path, but handles case-insensitive filesystems as described in the comment on Getwd for the case where the path is relative and the cwd needs to be obtained
func ExpandHomeDir ¶ added in v0.13.1
ExpandHomeDir expands a given path to its absolute form, handling home directory
func GetHostStableID ¶ added in v0.12.3
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 Getwd ¶ added in v0.15.0
Getwd returns the current working directory, but handles case-insensitive filesystems (i.e. MacOS defaults) and returns the path with the casing as it appears when doing list dir syscalls. For example, on a case-insensitive filesystem, you can do "cd /FoO/bAr" and os.Getwd will return "/FoO/bAr", but if you do "ls /" you may see "fOO" and if you do "ls /fOO" you may see "BAR", which creates inconsistent paths depending on if you are using Getwd or walking the filesystem.
func LexicalRelativePath ¶ added in v0.12.6
LexicalRelativePath computes a relative path between the current working directory and modPath without relying on runtime.GOOS to estimate OS-specific separators. This is necessary as the code runs inside a Linux container, but the user might have specified a Windows-style modPath.
Types ¶
type BuildkitSessionServer ¶ added in v0.11.8
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 (*Client) AppendHTTPRequestHeaders ¶ added in v0.11.8
func (*Client) Dagger ¶ added in v0.8.8
A client to the Dagger API hooked up directly with this engine client.
func (*Client) DialContext ¶
type DirectConn ¶ added in v0.8.8
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) Host ¶ added in v0.8.8
func (f DirectConn) Host() string
type FilesyncSource ¶ added in v0.11.5
type FilesyncSource Filesyncer
func (FilesyncSource) DiffCopy ¶ added in v0.11.5
func (s FilesyncSource) DiffCopy(stream filesync.FileSync_DiffCopyServer) error
func (FilesyncSource) Register ¶ added in v0.11.5
func (s FilesyncSource) Register(server *grpc.Server)
func (FilesyncSource) TarStream ¶ added in v0.11.5
func (s FilesyncSource) TarStream(stream filesync.FileSync_TarStreamServer) error
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 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 EngineCallback func(context.Context, string, string, string) 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 session.WithTerminalFunc }
type SocketProvider ¶
type SocketProvider struct {
EnableHostNetworkAccess bool
}
func (SocketProvider) CheckAgent ¶
func (p SocketProvider) CheckAgent(ctx context.Context, req *sshforward.CheckAgentRequest) (*sshforward.CheckAgentResponse, error)
func (SocketProvider) ForwardAgent ¶
func (p SocketProvider) ForwardAgent(stream sshforward.SSH_ForwardAgentServer) error
func (SocketProvider) Register ¶
func (p SocketProvider) Register(server *grpc.Server)