MCPcopy Create free account
hub / github.com/dagger/dagger / ReadCallerHostFile

Method ReadCallerHostFile

engine/engineutil/filesync.go:47–58  ·  view source on GitHub ↗
(ctx context.Context, path string)

Source from the content-addressed store, hash-verified

45}
46
47func (c *Client) ReadCallerHostFile(ctx context.Context, path string) ([]byte, error) {
48 msg := filesync.BytesMessage{}
49 err := c.diffcopy(ctx, engine.LocalImportOpts{
50 Path: path,
51 ReadSingleFileOnly: true,
52 MaxFileSize: MaxFileContentsChunkSize,
53 }, &msg)
54 if err != nil {
55 return nil, fmt.Errorf("failed to read file: %w", err)
56 }
57 return msg.Data, nil
58}
59
60// Return the absolute path of the given path as calculated by the caller's host using OS-specific rules.
61func (c *Client) AbsPath(ctx context.Context, path string) (string, error) {

Callers 1

readWorkspaceLockStateFunction · 0.45

Calls 1

diffcopyMethod · 0.95

Tested by

no test coverage detected