Documentation
¶
Overview ¶
Package storageref resolves the first path segment of a file-protocol address to a storage.
Every protocol addresses a storage the same way — it is the first segment of the path (`/dav/<ref>/…`, `/<ref>/…` over SFTP and NFS, the bucket over the S3-compatible API) — and for the life of the project that segment was the storage's NAME. A name is editable, which is the point of a name, so renaming a storage silently re-addressed it and every mount, bookmark and script written against the old one answered 404 (issue #21).
Every storage now also carries a uid, assigned once and never changed. Both resolve, everywhere, through this one function: a person types the name, an automated mount is given the uid and survives every rename. Putting the rule here rather than in each server is deliberate — five copies of "which identifier is this" would drift, and a protocol where only one of them worked would be a product that behaves differently depending on how you reach it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
Resolve returns the storage a path segment addresses, or the lookup's own error when there is none.
⚠ A uid-shaped ref that matches no storage falls back to the name lookup, rather than stopping at "no such uid". Nothing forbids naming a storage something that looks like a uuid, and a name that worked before this function existed must go on working after it.