Documentation
¶
Overview ¶
Package store は、MangaState(状態ドキュメント)の永続化を提供します。 state は GCS またはローカルの comic_state.json として保存され、これが作品の 唯一の真実源になります。履歴一覧はアプリ側がこのファイル群を列挙して実現します。
入出力には encoding/json/v2 を使います。v1 と違って重複したメンバー名を既定で 拒否するためで、唯一の真実源のロード口としては「壊れた state を黙って後勝ちで 読む」より「壊れていると言う」ほうが正しいからです。
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Load ¶
func Load(ctx context.Context, reader ports.ContentReader, statePath string) (*comic.MangaState, error)
Load は指定パス(GCS URI またはローカルパス)から MangaState を読み込みます。
失敗は ports の番兵エラーで分類して返します。state が「まだ無い」のか「壊れている」のか 「読めなかった」のかは呼び出し側の応答(404 / 400 / 502)が変わるところなので、 メッセージではなく errors.Is で見分けられる必要があります。
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.