Skip to main content
Memory Stores

Memory Store 数据结构

Memory Store、条目(entry)、版本(version)对象的完整结构定义。

Memory Store 对象

由创建、获取、列表和归档接口返回。
字段类型说明
idstringMemory Store ID,前缀 memstore_
typestring固定为 "memory_store"
namestring存储名称。服务器会自动 trim;最多 64 个字符
descriptionstring存储描述。服务器会自动 trim;最多 1024 个字符
statusstring存储状态。参见 Memory Store status
entry_countinteger存储中活跃的 memory 条目数
total_sizeinteger活跃 memory 条目的总大小(字节)
metadataobjectMetadata 对象。默认 {}
archived_atstringUTC 归档时间,仅在已归档时返回
created_atstringUTC 创建时间
updated_atstringUTC 最后更新时间

Memory Store status

说明
active存储可接受新的 memory 条目及条目更新
archived存储已归档。条目和版本可读取,但不能创建或更新条目

Memory entry 对象

由创建条目、获取条目、列表条目和更新条目接口返回。
字段类型说明
idstringMemory 条目 ID,前缀 mem_
typestring固定为 "memory"
store_idstring所属 Memory Store ID
pathstring相对 memory 路径。最大 1024 字节;不能以 / 开头且不能包含 ..
sizeinteger内容大小(字节)
content_sha256string当前内容的 SHA-256 摘要
versioninteger当前条目版本。首个版本为 1,每次更新递增
metadataobjectMetadata 对象。默认 {}
contentstring创建、获取和更新响应中返回(内容可用时)。列表响应中省略
created_atstringUTC 创建时间
updated_atstringUTC 最后更新时间
条目 content 在创建和更新时必填。trim 后不能为空,且最大 100 KB。

Memory version 对象

由列表版本和获取版本接口返回。
字段类型说明
idstringMemory 版本 ID,前缀 memver_
typestring固定为 "memory_version"
store_idstring所属 Memory Store ID
entry_idstringMemory 条目 ID
entry_pathstring记录此版本时条目的 path
sizeinteger版本内容大小(字节)
content_sha256string版本内容的 SHA-256 摘要
actionstring版本动作。参见 Memory version action
redactedboolean版本内容是否已被编辑(脱敏)
redacted_atstringUTC 编辑时间,仅在 redactedtrue 时返回
contentstring仅在获取版本时且版本未编辑、内容可用时返回
created_atstringUTC 创建时间

Memory version action

说明
created条目被创建
updated条目内容被更新
deleted条目被删除。历史版本记录中可包含此动作