MCPcopy
hub / github.com/larksuite/cli / FileIO

Method FileIO

shortcuts/common/runner.go:554–568  ·  view source on GitHub ↗

FileIO resolves the FileIO using the current execution context. Falls back to the globally registered provider when Factory or its FileIOProvider is nil (e.g. in lightweight test helpers).

()

Source from the content-addressed store, hash-verified

552// Falls back to the globally registered provider when Factory or its
553// FileIOProvider is nil (e.g. in lightweight test helpers).
554func (ctx *RuntimeContext) FileIO() fileio.FileIO {
555 if ctx != nil && ctx.Factory != nil {
556 if fio := ctx.Factory.ResolveFileIO(ctx.ctx); fio != nil {
557 return fio
558 }
559 }
560 if p := fileio.GetProvider(); p != nil {
561 c := context.Background()
562 if ctx != nil {
563 c = ctx.ctx
564 }
565 return p.ResolveFileIO(c)
566 }
567 return nil
568}
569
570// ResolveSavePath resolves a relative path to a validated absolute path via
571// FileIO.ResolvePath. It returns an error if no FileIO provider is registered

Callers 15

ResolveSavePathMethod · 0.95
ValidatePathMethod · 0.95
markdownSourceSizeFunction · 0.80
uploadMarkdownLocalFileFunction · 0.80
markdown_fetch.goFile · 0.80
readMarkdownLocalFileFunction · 0.80
saveTranscriptToFileFunction · 0.80
vc_notes.goFile · 0.80

Calls 2

GetProviderFunction · 0.92
ResolveFileIOMethod · 0.65