MCPcopy Index your code
hub / github.com/dagger/dagger / Stat

Method Stat

core/modulesource.go:2051–2069  ·  view source on GitHub ↗
(ctx context.Context, path string)

Source from the content-addressed store, hash-verified

2049}
2050
2051func (fs ModuleSourceStatFS) Stat(ctx context.Context, path string) (string, *Stat, error) {
2052 if fs.src == nil {
2053 return "", nil, os.ErrNotExist
2054 }
2055
2056 switch fs.src.Kind {
2057 case ModuleSourceKindLocal:
2058 path = filepath.Join(fs.src.Local.ContextDirectoryPath, fs.src.SourceRootSubpath, path)
2059 return CallerStatFS{fs.bk}.Stat(ctx, path)
2060 case ModuleSourceKindGit:
2061 path = filepath.Join("/", fs.src.SourceRootSubpath, path)
2062 return CallDirStat(ctx, fs.src.Git.UnfilteredContextDir, path)
2063 case ModuleSourceKindDir:
2064 path = filepath.Join("/", fs.src.SourceRootSubpath, path)
2065 return CallDirStat(ctx, fs.src.ContextDirectory, path)
2066 default:
2067 return "", nil, fmt.Errorf("unsupported module source kind: %s", fs.src.Kind)
2068 }
2069}
2070
2071func (fs ModuleSourceStatFS) Exists(ctx context.Context, path string) (string, bool, error) {
2072 if fs.src == nil {

Callers

nothing calls this directly

Calls 2

CallDirStatFunction · 0.85
StatMethod · 0.65

Tested by

no test coverage detected