objectkey

package
v1.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package objectkey 是对象名的唯一构造与解析入口。

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidObjectName = errors.New("objectkey: 对象名不合法")

ErrInvalidObjectName 对象名不合法。

Functions

func ContentType

func ContentType(ext string) string

ContentType 由 ext 派生 Content-Type;未知后缀回落二进制流。

func ExportObjectName

func ExportObjectName(md5 string) string

ExportObjectName 由 md5 构造导出产物名:export/{md5}.zip。

func IsLowerHex32

func IsLowerHex32(s string) bool

IsLowerHex32 判断 s 是否为 32 位小写 hex(内容摘要的合法形态)。

func IsValidExt

func IsValidExt(ext string) bool

IsValidExt 判断 ext 是否为合法的归一化后缀:空串,或 1..16 位 [a-z0-9]。

func ObjectName

func ObjectName(md5, ext string) string

ObjectName 由 (md5, ext) 构造对象名;ext 为空时不拼点。

func ParseObjectName

func ParseObjectName(name string) (md5, ext string, err error)

ParseObjectName 解析用户对象名,返回 (md5, ext);只允许用 filepath.Ext 取后缀段,按段数切分会把多点的名字判错。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL