forge
Clone
https://git.tahinli.com/Tahinli/forge.git
0 watching0 forksRustAGPL-3.07.1 MiB490f099Tahinli7 hours ago322 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, the repo's |
| 4 | //! name, description, visibility, archived flag or default branch, the open issue and pull counts, |
| 5 | //! the discussions and wiki switches, the viewer's own watch level, or the mirror's last sync. The |
| 6 | //! header follows the repo's issues and pulls, so an issue or pull opened or closed shows at once. |
| 7 | //! On a code view of a branch it also sends `changed` when the branch moves, or when a branch or |
| 8 | //! tag is created or deleted (the ref selector and the branch list depend on that). Moves of other |
| 9 | //! refs send nothing. Commits and tags are not followed: they do not move. |
| 10 | //! |
| 11 | //! The repo home page (`home_live_url`) also follows the releases, and sends `changed` when the |
| 12 | //! latest release or the linked packages' versions change. Other repo pages do not read those. |
| 13 | |
| 14 | use PathBuf; |
| 15 | |
| 16 | use ; |
| 17 | use ; |
| 18 | use Result; |
| 19 | use ; |
| 20 | use Response; |
| 21 | use ; |
| 22 | |
| 23 | use cratepercent_encode; |
| 24 | use crate; |
| 25 | use craterepo_package_links; |
| 26 | use crateload_refs; |
| 27 | use crate; |
| 28 | use crateruns_fingerprint; |
| 29 | use crateAppState; |
| 30 | |
| 31 | path_param!; |
| 32 | path_param!; |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | /// Whether a code view of `ref_name` follows the branch: the ref is a branch of the repo. |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | /// The stream URL of a code view that follows `branch`, whether or not the branch exists yet. |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | /// The stream URL of the repo home page: the branch's stream, which also follows the releases and |
| 52 | /// the linked packages. |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | /// The stream URL of a repo page. A code view of a branch adds the branch to it. |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | /// The state the code view shows: every branch and tag name, and the commit `branch` points at. |
| 67 | /// A move of another branch leaves it unchanged. |
| 68 | async |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | /// The state the repo header shows. A repo that is gone reads as empty, which ends nothing: the |
| 83 | /// stream then sends `changed` once and the page's own re-read shows the 404. `viewer_id` is the |
| 84 | /// signed-in viewer, whose watch level the header shows. |
| 85 | async |
| 86 | |
| 87 | |
| 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 | |
| 118 | |
| 119 | |
| 120 | /// Joins the header's fields into the fingerprint text. |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | /// The state the home page's latest release and linked-package card show. |
| 131 | async |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | /// The repo's live stream. Auth is the repo read check of the page: a viewer who cannot read the |
| 161 | /// repo gets the same 404 as the page. |
| 162 | |
| 163 | async |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
| 208 | |
| 209 | |
| 210 | |
| 211 | |
| 212 | |
| 213 | |
| 214 | |
| 215 | |
| 216 | |
| 217 | |
| 218 | |
| 219 | |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | |
| 227 | |
| 228 | |
| 229 | |
| 230 | |
| 231 | |
| 232 | |
| 233 | |
| 234 | |
| 235 | |
| 236 | |
| 237 | |
| 238 | |
| 239 | |
| 240 | |
| 241 | |
| 242 | |
| 243 | |
| 244 |