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

Function downloadMarkdownContent

shortcuts/markdown/markdown_diff.go:169–181  ·  view source on GitHub ↗
(ctx context.Context, runtime *common.RuntimeContext, fileToken, version string)

Source from the content-addressed store, hash-verified

167}
168
169func downloadMarkdownContent(ctx context.Context, runtime *common.RuntimeContext, fileToken, version string) (string, string, error) {
170 resp, fileName, err := openMarkdownDownloadVersion(ctx, runtime, fileToken, version)
171 if err != nil {
172 return "", "", err
173 }
174 defer resp.Body.Close()
175
176 payload, err := readMarkdownDiffPayload(resp.Body, "remote Markdown content")
177 if err != nil {
178 return "", "", wrapMarkdownDownloadError(err)
179 }
180 return fileName, string(payload), nil
181}
182
183func readMarkdownLocalFile(runtime *common.RuntimeContext, filePath string) (string, error) {
184 f, err := runtime.FileIO().Open(filePath)

Callers 1

markdown_diff.goFile · 0.85

Calls 4

readMarkdownDiffPayloadFunction · 0.85
CloseMethod · 0.45

Tested by

no test coverage detected