← Về thư mục
openai4s/server/share_service.py
- new_share_id · function · L40-L44 — def new_share_id() -> str
- TunnelPort · class · L47-L54 — class TunnelPort
- add_share · method · L50-L51 — def add_share(self, share_id: str) -> None: # pragma: no cover - protocol
- remove_share · method · L53-L54 — def remove_share(self, share_id: str) -> None: # pragma: no cover - protocol
- ShareService · class · L57-L616 — class ShareService
- init · method · L58-L85 — def init( self, store: Any, *, builder: ShareProjectionBuilder, shares_dir: str | Path, public_url: PublicUrl, active_branch: ActiveBranch, run_in_ticket: TicketRunner | None = None, tunnel: TunnelPort | None = None, clock: Callable[[], float] | None = None, ) -> None
- _inline_ticket · method · L89-L94 — def _inline_ticket( root_frame_id: str, branch_id: str, fn: Callable[[Any], ShareProjection], ) -> ShareProjection
- _lock_for · method · L96-L101 — def _lock_for(self, share_id: str) -> threading.Lock
- _dir · method · L103-L104 — def _dir(self, share_id: str) -> Path
- _snapshots_dir · method · L106-L107 — def _snapshots_dir(self, share_id: str) -> Path
- _current_path · method · L109-L110 — def _current_path(self, share_id: str) -> Path
- _new_snapshot_id · method · L112-L113 — def _new_snapshot_id(self) -> str
- _fsync_file · method · L116-L124 — def _fsync_file(path: Path) -> None
- _fsync_dir · method · L127-L135 — def _fsync_dir(path: Path) -> None
- create · method · L138-L154 — def create( self, root_frame_id: str, *, title: str | None = None, expires_at: int | None = None, ) -> dict[str, Any]
- update · method · L156-L169 — def update(self, share_id: str, *, expires_at: Any = _KEEP) -> dict[str, Any]
- _publish · method · L171-L238 — def _publish( self, share_id: str, root_frame_id: str, *, title: str | None, create: bool, expires_at: int | None = None, ) -> dict[str, Any]
- _build · function · L195-L198 — def _build(cancel_event: Any) -> ShareProjection
- _meta · method · L240-L273 — def _meta( self, share_id: str, root_frame_id: str, title: str | None, projection: ShareProjection, bundle: dict[str, Any], ) -> dict[str, Any]
- _write_snapshot · method · L275-L307 — def _write_snapshot( self, share_id: str, snapshot_id: str, projection: ShareProjection, bundle: dict[str, Any], view: bytes, meta: dict[str, Any], ) -> None
- _swap_pointer · method · L309-L324 — def _swap_pointer( self, share_id: str, snapshot_id: str, projection_id: str ) -> None
- revoke · method · L327-L341 — def revoke(self, share_id: str) -> dict[str, Any]
- revoke_for_session · method · L343-L351 — def revoke_for_session(self, root_frame_id: str) -> None
- _remove_share_tree · method · L353-L357 — def _remove_share_tree(self, root_frame_id: str) -> None
- list_for_frame · method · L360-L364 — def list_for_frame(self, root_frame_id: str) -> list[dict[str, Any]]
- list_all · method · L366-L367 — def list_all(self) -> list[dict[str, Any]]
- public_record · method · L369-L373 — def public_record(self, share_id: str) -> dict[str, Any]
- _public_row · method · L375-L390 — def _public_row(self, row: dict[str, Any]) -> dict[str, Any]
- acquire · method · L393-L409 — def acquire(self, share_id: str) -> tuple[str, Path] | None
- release · method · L411-L420 — def release(self, share_id: str, snapshot_id: str) -> None
- _read_pointer · method · L422-L428 — def _read_pointer(self, share_id: str) -> str | None
- _lease_count · method · L430-L432 — def _lease_count(self, share_id: str, snapshot_id: str) -> int
- _gc · method · L435-L457 — def _gc(self, share_id: str, *, drop_all: bool = False) -> None
- _maybe_remove_dir · method · L459-L465 — def _maybe_remove_dir(self, share_id: str) -> None
- _discard_snapshot · method · L467-L474 — def _discard_snapshot(self, share_id: str, snapshot_id: str) -> None
- _reconcile_row_after_failure · method · L476-L491 — def _reconcile_row_after_failure(self, share_id: str) -> None
- sweep_expired · method · L494-L506 — def sweep_expired(self, *, now_ms: int | None = None) -> list[str]
- start_sweeper · method · L508-L523 — def start_sweeper(self, *, interval: float = 60.0) -> None
- _loop · function · L513-L518 — def _loop() -> None
- stop_sweeper · method · L525-L528 — def stop_sweeper(self) -> None
- restore · method · L531-L565 — def restore(self) -> list[str]
- _recover_publishing · method · L567-L594 — def _recover_publishing(self, share_id: str, row: dict[str, Any]) -> None
- _snapshot_ok · method · L596-L616 — def _snapshot_ok( self, share_id: str, snapshot_id: Any, row: dict[str, Any], *, match_sha: bool = True, ) -> bool
- ShareConflict · class · L619-L624 — class ShareConflict(RuntimeError)
- init · method · L622-L624 — def init(self, existing_share_id: str) -> None