MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / Link

Method Link

drivers/ipfs_api/driver.go:80–84  ·  view source on GitHub ↗
(ctx context.Context, file model.Obj, args model.LinkArgs)

Source from the content-addressed store, hash-verified

78}
79
80func (d *IPFS) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
81 gateurl := d.gateURL.JoinPath("/ipfs/", file.GetID())
82 gateurl.RawQuery = "filename=" + url.QueryEscape(file.GetName())
83 return &model.Link{URL: gateurl.String()}, nil
84}
85
86func (d *IPFS) Get(ctx context.Context, rawPath string) (model.Obj, error) {
87 rawPath = path.Join(d.GetRootPath(), rawPath)

Callers

nothing calls this directly

Calls 4

JoinPathMethod · 0.80
GetIDMethod · 0.65
GetNameMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected