MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / BuildDirectLink

Function BuildDirectLink

service/explorer/response.go:467–474  ·  view source on GitHub ↗
(d *ent.DirectLink, hasher hashid.Encoder, base *url.URL)

Source from the content-addressed store, hash-verified

465}
466
467func BuildDirectLink(d *ent.DirectLink, hasher hashid.Encoder, base *url.URL) DirectLink {
468 return DirectLink{
469 ID: hashid.EncodeSourceLinkID(hasher, d.ID),
470 URL: routes.MasterDirectLink(base, hashid.EncodeSourceLinkID(hasher, d.ID), d.Name).String(),
471 Downloaded: d.Downloads,
472 CreatedAt: d.CreatedAt,
473 }
474}
475
476func BuildEntity(ctx context.Context, extendedInfo *fs.FileExtendedInfo, e fs.Entity, hasher hashid.Encoder) Entity {
477 var u *user.User

Callers 1

BuildExtendedInfoFunction · 0.85

Calls 3

EncodeSourceLinkIDFunction · 0.92
MasterDirectLinkFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected