forge
Clone
https://git.tahinli.com/Tahinli/forge.git
0 watching0 forksRustAGPL-3.010.5 MiB3d53dfdTahinli1 month ago208 commits
| 1 | //! Live stream of a repo's pages, at `/{owner}/{repo}/events`. The repo header renders `data-live` |
| 2 | //! with this URL on every repo page (see `repo::repo_head`). A code view adds its branch to the |
| 3 | //! URL. The stream sends `changed` when the header changes: stars, watchers, forks, or the repo's |
| 4 | //! name, description or visibility. On a code view of a branch it also sends `changed` when the |
| 5 | //! branch moves, or when a branch or tag is created or deleted (the ref selector and the branch |
| 6 | //! list depend on that). Moves of other refs send nothing. Commits and tags are not followed: they |
| 7 | //! do not move. |
| 8 | |
| 9 | use PathBuf; |
| 10 | |
| 11 | use Visibility; |
| 12 | use ; |
| 13 | use Result; |
| 14 | use ; |
| 15 | use Response; |
| 16 | use ; |
| 17 | |
| 18 | use cratepercent_encode; |
| 19 | use crate; |
| 20 | use crateload_refs; |
| 21 | use crate; |
| 22 | use crateAppState; |
| 23 | |
| 24 | path_param!; |
| 25 | path_param!; |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | /// Whether a code view of `ref_name` follows the branch: the ref is a branch of the repo. |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | /// The stream URL of a code view that follows `branch`, whether or not the branch exists yet. |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | /// The stream URL of a repo page. A code view of a branch adds the branch to it. |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | /// The state the code view shows: every branch and tag name, and the commit `branch` points at. |
| 53 | /// A move of another branch leaves it unchanged. |
| 54 | async |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | /// The state the repo header shows. A repo that is gone reads as empty, which ends nothing: the |
| 69 | /// stream then sends `changed` once and the page's own re-read shows the 404. |
| 70 | async |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | /// The repo's live stream. Auth is the repo read check of the page: a viewer who cannot read the |
| 85 | /// repo gets the same 404 as the page. |
| 86 | |
| 87 | async |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 |