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

Function uploadMarkdownLocalFile

shortcuts/markdown/helpers.go:398–408  ·  view source on GitHub ↗
(runtime *common.RuntimeContext, spec markdownUploadSpec, fileSize int64)

Source from the content-addressed store, hash-verified

396}
397
398func uploadMarkdownLocalFile(runtime *common.RuntimeContext, spec markdownUploadSpec, fileSize int64) (markdownUploadResult, error) {
399 fileName := finalMarkdownFileName(spec)
400 if fileSize > markdownSinglePartSizeLimit {
401 return uploadMarkdownFileMultipart(runtime, spec, fileName, fileSize, func() (io.ReadCloser, error) {
402 return runtime.FileIO().Open(spec.FilePath)
403 })
404 }
405 return uploadMarkdownFileAll(runtime, spec, fileName, fileSize, func() (io.ReadCloser, error) {
406 return runtime.FileIO().Open(spec.FilePath)
407 })
408}
409
410func uploadMarkdownFileAll(runtime *common.RuntimeContext, spec markdownUploadSpec, fileName string, fileSize int64, openReader func() (io.ReadCloser, error)) (markdownUploadResult, error) {
411 target := spec.Target()

Callers 2

markdown_create.goFile · 0.85

Calls 5

finalMarkdownFileNameFunction · 0.85
uploadMarkdownFileAllFunction · 0.85
FileIOMethod · 0.80
OpenMethod · 0.65

Tested by

no test coverage detected