MCPcopy Index your code
hub / github.com/AlistGo/alist / Link

Method Link

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

Source from the content-addressed store, hash-verified

166}
167
168func (d *Github) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error) {
169 obj, err := d.get(file.GetPath())
170 if err != nil {
171 return nil, err
172 }
173 if obj.Type == "submodule" {
174 return nil, errors.New("cannot download a submodule")
175 }
176 url := obj.DownloadURL
177 ghProxy := strings.TrimSpace(d.Addition.GitHubProxy)
178 if ghProxy != "" {
179 url = strings.Replace(url, "https://raw.githubusercontent.com", ghProxy, 1)
180 }
181 return &model.Link{
182 URL: url,
183 }, nil
184}
185
186func (d *Github) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
187 if !d.isOnBranch {

Callers

nothing calls this directly

Calls 2

getMethod · 0.95
GetPathMethod · 0.65

Tested by

no test coverage detected