MCPcopy
hub / github.com/OpenListTeam/OpenList / get

Method get

drivers/github/driver.go:674–685  ·  view source on GitHub ↗
(path string)

Source from the content-addressed store, hash-verified

672}
673
674func (d *Github) get(path string) (*Object, error) {
675 res, err := d.client.R().SetQueryParam("ref", d.Ref).Get(d.getContentApiUrl(path))
676 if err != nil {
677 return nil, err
678 }
679 if res.StatusCode() != 200 {
680 return nil, toErr(res)
681 }
682 var resp Object
683 err = utils.Json.Unmarshal(res.Body(), &resp)
684 return &resp, err
685}
686
687func (d *Github) putBlob(ctx context.Context, s model.FileStreamer, up driver.UpdateProgress) (string, error) {
688 beforeContent := "{\"encoding\":\"base64\",\"content\":\""

Callers 6

ListMethod · 0.95
LinkMethod · 0.95
MakeDirMethod · 0.95
PutMethod · 0.95
getTreeDirectlyMethod · 0.95
copyWithoutRenewTreeMethod · 0.95

Calls 4

getContentApiUrlMethod · 0.95
toErrFunction · 0.85
GetMethod · 0.65
UnmarshalMethod · 0.45

Tested by

no test coverage detected