Documentation ¶
Index ¶
- func ComputeFileCID(f io.ReadSeeker) (string, error)
- func ImageVariantPath(id, variant string) string
- func IsLegacyCID(cid string) bool
- func IsLegacyCIDStrict(cid string) bool
- func ShardCID(cidStr string) string
- func UnescapeCidParam(next echo.HandlerFunc) echo.HandlerFunc
- func ValidateCID(expectedCID string, f io.ReadSeeker) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeFileCID ¶
func ComputeFileCID(f io.ReadSeeker) (string, error)
func ImageVariantPath ¶
/img/shard/orig_cid/150x150.jpg
func IsLegacyCID ¶
Returns true both for "Qm" CIDs AND for for keys like "Qmwhatever/150x150.jpg" to support legacy migrated keys
func IsLegacyCIDStrict ¶
Only returns true for exact v0 CIDs (46 chars and start with "Qm")
func ShardCID ¶
Returns a sharded filepath/key for CID based on CID version. V0: last 3 chars, offset by 1 V1: last 5 chars Fallback: unchanged (for legacy migrated keys like "Qm.../150x150.jpg")
func UnescapeCidParam ¶
func UnescapeCidParam(next echo.HandlerFunc) echo.HandlerFunc
func ValidateCID ¶
func ValidateCID(expectedCID string, f io.ReadSeeker) error
note: any Qm CID will be invalid because its hash won't match the contents
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.