Documentation
¶
Overview ¶
Package layout defines media object keys, dependency-free so the access worker can classify paths without importing the media runtime:
{tenant}/{kind}/{content_id}/manifest.json | manifests/{version}.json
/originals/{sha256-hex | slot | slot.json | i-uuid}
/staging/{u-uuid} multipart uploads until placed; never served
/blobs/{sha256-hex | u-uuid} viewer token
/editor/{sha256-hex | name.webp} editor token
/public/{name}.webp
Index ¶
Constants ¶
View Source
const ( AreaManifest = "manifest" // manifest.json and manifests/{version}.json AreaOriginals = "originals" AreaBlobs = "blobs" AreaPublic = "public" // AreaEditor holds what only editors may fetch: EditorOnly variant blobs // and video posters before they are published. AreaEditor = "editor" // AreaStaging holds multipart uploads (u-{uuid}) until the media worker // hashes them and places them in originals/ under their SHA-256. AreaStaging = "staging" )
Folder areas.
View Source
const ( SHA256Prefix = "sha256-" UploadPrefix = "u-" InlinePrefix = "i-" PublicExt = ".webp" )
Variables ¶
This section is empty.
Functions ¶
func ParseSHA256Name ¶
ParseSHA256Name returns the digest of a "sha256-{hex}" name.
func SourceArea ¶ added in v0.40.0
SourceArea is where an uploaded file named name lives: staging/ for a "u-{uuid}" not yet placed, originals/ for a "sha256-{hex}".
func ValidBlobName ¶
ValidBlobName accepts "sha256-{64 lowercase hex}" and "u-{uuid}".
func ValidInlineName ¶ added in v0.17.0
ValidInlineName accepts "i-{uuid}", an inline image's id.
func ValidSegment ¶
ValidSegment keeps keys stable ASCII: [A-Za-z0-9._-]{1,128}, no leading dot.
func ValidStagedName ¶ added in v0.40.0
ValidStagedName accepts "u-{uuid}", an upload whose hash is not yet known.
Types ¶
Click to show internal directories.
Click to hide internal directories.