Documentation
¶
Overview ¶
Package api 是账本域对协作房间域的薄门面(B156.2 还债路径):包住既有 *ledger.Store,逐方法转调并做 Event→proto.LedgerEvent 映射(先例 ledgerEventWire,internal/agentd/ledgerapi.go:106),不含任何业务判断。 由组装点构造并注入 collab.New;组装点之外只认 client.LedgerClient 接口, 不要直接引用本包的具体类型。
本文件属直通镜像接线:转调体照抄既有同形方法的接线形态。
keystone 半段(B156.3 门面归一轮补入):keystone 域经 keysclient.LedgerView 端口消费的两条账本能力。逐方法转调既有 Store 实现,不含任何业务判断—— 唤醒决策与兜底链的规则归 d_keystone(B156.3 spec §7.1)。
跨卡约束:本文件与 registry.go 是与 B156.2 商定的新增落点,api.go 一个 字符不动;两份门面已归一,internal/ledgerapi 不复存在。
注册表半段(B156.3 门面归一轮补入):编制域经 schedclient.Registry 端口 消费的四个版本化 KV 原语。逐方法转调 internal/ledger/registry.go 的既有 Store 实现 + RegistryEntry→本包 DTO 映射,不含任何业务判断——载体/小队的 规则归 d_scheduling(B156.3 spec §7.1)。
跨卡约束:本文件与 keystone.go 是与 B156.2 商定的新增落点,api.go 一个 字符不动;两份门面已归一,internal/ledgerapi 不复存在。
Index ¶
- type Facade
- func (f *Facade) BindDriver(id, session, carrier, expect string) error
- func (f *Facade) Delete(kind, id string, expectVersion int, actor string) error
- func (f *Facade) DriverLease(session string) (time.Time, bool, error)
- func (f *Facade) EffectiveBaseBranch(id string) (string, error)
- func (f *Facade) EventsFromAsc(cardIDs []string, fromSeq int64, limit int) ([]proto.LedgerEvent, error)
- func (f *Facade) Get(kind, id string) (RegistryEntry, error)
- func (f *Facade) GetCard(id string) (proto.Card, error)
- func (f *Facade) List(kind string) ([]RegistryEntry, error)
- func (f *Facade) ListActiveCards(project string) ([]proto.Card, error)
- func (f *Facade) ListAllCards(project string) ([]proto.Card, error)
- func (f *Facade) MarkNeedsHuman(cardID, reason, actor string) error
- func (f *Facade) Put(kind, id string, expectVersion int, body []byte, actor string) (int, error)
- func (f *Facade) RecordMessageConsumed(cardID string, msgSeq int64, consumer string) error
- func (f *Facade) RecordRoomMessage(cardID string, msg proto.RoomMessage, actor string) (int64, error)
- type RegistryEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Facade ¶
type Facade struct {
// contains filtered or unexported fields
}
Facade 实现 client.LedgerClient;组装点之外请只认接口。
func (*Facade) BindDriver ¶
func (*Facade) EffectiveBaseBranch ¶
EffectiveBaseBranch 读卡的有效基线分支(透传 Store.EffectiveBaseBranch, internal/ledger/relations.go)。开场评估与重建四步的新鲜度判据。
func (*Facade) EventsFromAsc ¶
func (*Facade) Get ¶
func (f *Facade) Get(kind, id string) (RegistryEntry, error)
Get 读一条注册表实体(透传;不存在返回 ledger.ErrNotFound 包装错误)。
func (*Facade) List ¶
func (f *Facade) List(kind string) ([]RegistryEntry, error)
List 按 kind 列出全部实体,seq 升序(透传)。
func (*Facade) ListActiveCards ¶
func (*Facade) ListAllCards ¶
ListAllCards 是 ListCards{IncludeTerminal:true} 的直通镜像(B156.2 岔口一 方案甲还债直通):终态房间「沉底可列」与并入只读判定的唯一枚举源。 Following 投影随 CardView 直通,本方法不做任何业务判断。
func (*Facade) MarkNeedsHuman ¶
MarkNeedsHuman 打等人标记(透传 Store.MarkNeedsHuman, internal/ledger/events.go)。唤醒兜底链终点「转等人」经此落账。
func (*Facade) Put ¶
Put 以 CAS 语义写入注册表实体,返回新版本号(透传 Store.RegistryPut)。 expectVersion 必须等于当前版本;0 表示必须不存在(新建)。
func (*Facade) RecordMessageConsumed ¶
func (*Facade) RecordRoomMessage ¶
type RegistryEntry ¶
RegistryEntry 是注册表一行(载体/小队/点火队列等版本化实体)的门面 DTO。 字段与 ledger.RegistryEntry 一一对应:Seq 是全表单调写入序,Body 是写入方 序列化好的 JSON——账本不解释其内容。