2022-06-23 15:03:11 +00:00
|
|
|
package fs
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
2022-08-03 06:26:59 +00:00
|
|
|
|
2022-06-23 15:03:11 +00:00
|
|
|
"github.com/alist-org/alist/v3/internal/model"
|
2022-08-31 13:01:15 +00:00
|
|
|
"github.com/alist-org/alist/v3/internal/op"
|
2022-06-23 15:03:11 +00:00
|
|
|
"github.com/pkg/errors"
|
|
|
|
)
|
|
|
|
|
2022-06-28 13:58:46 +00:00
|
|
|
func link(ctx context.Context, path string, args model.LinkArgs) (*model.Link, model.Obj, error) {
|
2022-08-31 13:01:15 +00:00
|
|
|
storage, actualPath, err := op.GetStorageAndActualPath(path)
|
2022-06-23 15:03:11 +00:00
|
|
|
if err != nil {
|
2022-07-10 06:45:39 +00:00
|
|
|
return nil, nil, errors.WithMessage(err, "failed get storage")
|
2022-06-23 15:03:11 +00:00
|
|
|
}
|
2022-08-31 13:01:15 +00:00
|
|
|
return op.Link(ctx, storage, actualPath, args)
|
2022-06-23 15:03:11 +00:00
|
|
|
}
|