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 the item's one manifest; never served
/originals/sha256-{hex} uploads; never served
/staging/u-{uuid} multipart uploads until placed; never served
/private/sha256-{hex} every rendition; token-gated
/public/sha256-{hex} copies of the exposed renditions; anyone
Every name but staging's is the SHA-256 of the object, so objects are immutable: a change writes a new name.
Index ¶
Constants ¶
const ( AreaManifest = "manifest" AreaOriginals = "originals" AreaStaging = "staging" AreaPrivate = "private" AreaPublic = "public" )
Folder areas.
const ( SHA256Prefix = "sha256-" UploadPrefix = "u-" InlinePrefix = "i-" )
const ManifestName = "manifest.json"
ManifestName is the manifest's key within the folder.
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 ValidHashName ¶ added in v0.48.0
ValidHashName accepts "sha256-{64 lowercase hex}".
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 ValidSourceName ¶ added in v0.48.0
ValidSourceName accepts an uploaded file's name: a hash, or "u-{uuid}" until the worker places it.
func ValidStagedName ¶ added in v0.40.0
ValidStagedName accepts "u-{uuid}", an upload whose hash is not yet known.