MCPcopy Create free account
hub / github.com/cli/cli / fileContentResponseBytes

Function fileContentResponseBytes

pkg/cmd/repo/read-file/read_file_test.go:690–709  ·  view source on GitHub ↗
(name string, content []byte)

Source from the content-addressed store, hash-verified

688}
689
690func fileContentResponseBytes(name string, content []byte) map[string]any {
691 return map[string]any{
692 "type": "file",
693 "name": name,
694 "path": name,
695 "size": len(content),
696 "encoding": "base64",
697 "content": base64.StdEncoding.EncodeToString(content),
698 "sha": "deadbeef",
699 "url": "https://api.github.com/repos/OWNER/REPO/contents/" + name,
700 "git_url": "https://api.github.com/repos/OWNER/REPO/git/blobs/deadbeef",
701 "html_url": "https://github.com/OWNER/REPO/blob/main/" + name,
702 "download_url": "https://raw.githubusercontent.com/OWNER/REPO/main/" + name,
703 "_links": map[string]any{
704 "self": "https://api.github.com/repos/OWNER/REPO/contents/" + name,
705 "git": "https://api.github.com/repos/OWNER/REPO/git/blobs/deadbeef",
706 "html": "https://github.com/OWNER/REPO/blob/main/" + name,
707 },
708 }
709}
710
711func pngBytes() []byte {
712 return append([]byte("\x89PNG\r\n\x1a\n"), make([]byte, 16)...)

Callers 2

Test_readFileRunFunction · 0.85
fileContentResponseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected