├── .github ├── dependabot.yml └── workflows │ └── ci.yml ├── .gitignore ├── CODE_OF_CONDUCT.md ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── Makefile ├── README.md ├── assets └── demo.gif └── src ├── github.rs └── main.rs /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: cargo 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "20:00" 8 | open-pull-requests-limit: 10 9 | ignore: 10 | - dependency-name: serde 11 | versions: 12 | - 1.0.123 13 | - 1.0.124 14 | - dependency-name: serde_json 15 | versions: 16 | - 1.0.61 17 | - 1.0.62 18 | - 1.0.63 19 | - dependency-name: surf 20 | versions: 21 | - 2.1.0 22 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | pull_request: 5 | push: 6 | branches: 7 | - master 8 | 9 | env: 10 | RUSTFLAGS: -Dwarnings 11 | 12 | jobs: 13 | build_and_test: 14 | name: Build and test 15 | runs-on: ${{ matrix.os }} 16 | strategy: 17 | matrix: 18 | os: [ubuntu-latest, windows-latest, macOS-latest] 19 | rust: [nightly, beta] 20 | 21 | steps: 22 | - uses: actions/checkout@master 23 | 24 | - name: Install ${{ matrix.rust }} 25 | uses: actions-rs/toolchain@v1 26 | with: 27 | toolchain: ${{ matrix.rust }} 28 | override: true 29 | 30 | - name: build 31 | uses: actions-rs/cargo@v1 32 | with: 33 | command: build 34 | 35 | - name: tests 36 | uses: actions-rs/cargo@v1 37 | with: 38 | command: test 39 | args: --all 40 | 41 | - name: bench 42 | uses: actions-rs/cargo@v1 43 | if: matrix.rust == 'nightly' 44 | with: 45 | command: build 46 | args: --benches 47 | 48 | check_fmt_and_docs: 49 | name: Checking fmt and docs 50 | runs-on: ubuntu-latest 51 | steps: 52 | - uses: actions/checkout@master 53 | 54 | - uses: actions-rs/toolchain@v1 55 | with: 56 | profile: minimal 57 | toolchain: nightly 58 | override: true 59 | components: rustfmt 60 | 61 | - name: setup 62 | run: | 63 | rustup component add rustfmt 64 | rustc --version 65 | 66 | - name: Docs 67 | run: cargo doc 68 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | **/*.rs.bk 3 | /dist 4 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at htilcs1115@gmail.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "ansi_term" 5 | version = "0.12.1" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" 8 | dependencies = [ 9 | "winapi", 10 | ] 11 | 12 | [[package]] 13 | name = "async-channel" 14 | version = "1.6.1" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" 17 | dependencies = [ 18 | "concurrent-queue", 19 | "event-listener", 20 | "futures-core", 21 | ] 22 | 23 | [[package]] 24 | name = "async-executor" 25 | version = "1.4.0" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "eb877970c7b440ead138f6321a3b5395d6061183af779340b65e20c0fede9146" 28 | dependencies = [ 29 | "async-task", 30 | "concurrent-queue", 31 | "fastrand", 32 | "futures-lite", 33 | "once_cell", 34 | "vec-arena", 35 | ] 36 | 37 | [[package]] 38 | name = "async-global-executor" 39 | version = "2.0.2" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "9586ec52317f36de58453159d48351bc244bc24ced3effc1fce22f3d48664af6" 42 | dependencies = [ 43 | "async-channel", 44 | "async-executor", 45 | "async-io", 46 | "async-mutex", 47 | "blocking", 48 | "futures-lite", 49 | "num_cpus", 50 | "once_cell", 51 | ] 52 | 53 | [[package]] 54 | name = "async-io" 55 | version = "1.4.0" 56 | source = "registry+https://github.com/rust-lang/crates.io-index" 57 | checksum = "fcb9af4888a70ad78ecb5efcb0ba95d66a3cf54a88b62ae81559954c7588c7a2" 58 | dependencies = [ 59 | "concurrent-queue", 60 | "fastrand", 61 | "futures-lite", 62 | "libc", 63 | "log", 64 | "once_cell", 65 | "parking", 66 | "polling", 67 | "socket2 0.4.0", 68 | "vec-arena", 69 | "waker-fn", 70 | "winapi", 71 | ] 72 | 73 | [[package]] 74 | name = "async-lock" 75 | version = "2.4.0" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "e6a8ea61bf9947a1007c5cada31e647dbc77b103c679858150003ba697ea798b" 78 | dependencies = [ 79 | "event-listener", 80 | ] 81 | 82 | [[package]] 83 | name = "async-mutex" 84 | version = "1.4.0" 85 | source = "registry+https://github.com/rust-lang/crates.io-index" 86 | checksum = "479db852db25d9dbf6204e6cb6253698f175c15726470f78af0d918e99d6156e" 87 | dependencies = [ 88 | "event-listener", 89 | ] 90 | 91 | [[package]] 92 | name = "async-process" 93 | version = "1.0.2" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "ef37b86e2fa961bae5a4d212708ea0154f904ce31d1a4a7f47e1bbc33a0c040b" 96 | dependencies = [ 97 | "async-io", 98 | "blocking", 99 | "cfg-if 1.0.0", 100 | "event-listener", 101 | "futures-lite", 102 | "once_cell", 103 | "signal-hook", 104 | "winapi", 105 | ] 106 | 107 | [[package]] 108 | name = "async-std" 109 | version = "1.10.0" 110 | source = "registry+https://github.com/rust-lang/crates.io-index" 111 | checksum = "f8056f1455169ab86dd47b47391e4ab0cbd25410a70e9fe675544f49bafaf952" 112 | dependencies = [ 113 | "async-channel", 114 | "async-global-executor", 115 | "async-io", 116 | "async-lock", 117 | "async-process", 118 | "crossbeam-utils 0.8.0", 119 | "futures-channel", 120 | "futures-core", 121 | "futures-io", 122 | "futures-lite", 123 | "gloo-timers", 124 | "kv-log-macro", 125 | "log", 126 | "memchr", 127 | "num_cpus", 128 | "once_cell", 129 | "pin-project-lite", 130 | "pin-utils", 131 | "slab", 132 | "wasm-bindgen-futures 0.4.14", 133 | ] 134 | 135 | [[package]] 136 | name = "async-task" 137 | version = "4.0.3" 138 | source = "registry+https://github.com/rust-lang/crates.io-index" 139 | checksum = "e91831deabf0d6d7ec49552e489aed63b7456a7a3c46cff62adad428110b0af0" 140 | 141 | [[package]] 142 | name = "atomic-waker" 143 | version = "1.0.0" 144 | source = "registry+https://github.com/rust-lang/crates.io-index" 145 | checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" 146 | 147 | [[package]] 148 | name = "atty" 149 | version = "0.2.14" 150 | source = "registry+https://github.com/rust-lang/crates.io-index" 151 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 152 | dependencies = [ 153 | "hermit-abi", 154 | "libc", 155 | "winapi", 156 | ] 157 | 158 | [[package]] 159 | name = "autocfg" 160 | version = "1.0.0" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" 163 | 164 | [[package]] 165 | name = "bitflags" 166 | version = "1.2.1" 167 | source = "registry+https://github.com/rust-lang/crates.io-index" 168 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 169 | 170 | [[package]] 171 | name = "blocking" 172 | version = "1.0.0" 173 | source = "registry+https://github.com/rust-lang/crates.io-index" 174 | checksum = "2640778f8053e72c11f621b0a5175a0560a269282aa98ed85107773ab8e2a556" 175 | dependencies = [ 176 | "async-channel", 177 | "atomic-waker", 178 | "fastrand", 179 | "futures-lite", 180 | "once_cell", 181 | "waker-fn", 182 | ] 183 | 184 | [[package]] 185 | name = "bumpalo" 186 | version = "3.2.1" 187 | source = "registry+https://github.com/rust-lang/crates.io-index" 188 | checksum = "12ae9db68ad7fac5fe51304d20f016c911539251075a214f8e663babefa35187" 189 | 190 | [[package]] 191 | name = "byteorder" 192 | version = "1.3.4" 193 | source = "registry+https://github.com/rust-lang/crates.io-index" 194 | checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" 195 | 196 | [[package]] 197 | name = "bytes" 198 | version = "0.4.12" 199 | source = "registry+https://github.com/rust-lang/crates.io-index" 200 | checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" 201 | dependencies = [ 202 | "byteorder", 203 | "iovec", 204 | ] 205 | 206 | [[package]] 207 | name = "cache-padded" 208 | version = "1.1.1" 209 | source = "registry+https://github.com/rust-lang/crates.io-index" 210 | checksum = "631ae5198c9be5e753e5cc215e1bd73c2b466a3565173db433f52bb9d3e66dba" 211 | 212 | [[package]] 213 | name = "cc" 214 | version = "1.0.50" 215 | source = "registry+https://github.com/rust-lang/crates.io-index" 216 | checksum = "95e28fa049fda1c330bcf9d723be7663a899c4679724b34c81e9f5a326aab8cd" 217 | 218 | [[package]] 219 | name = "cfg-if" 220 | version = "0.1.10" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 223 | 224 | [[package]] 225 | name = "cfg-if" 226 | version = "1.0.0" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 229 | 230 | [[package]] 231 | name = "clap" 232 | version = "2.34.0" 233 | source = "registry+https://github.com/rust-lang/crates.io-index" 234 | checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" 235 | dependencies = [ 236 | "ansi_term", 237 | "atty", 238 | "bitflags", 239 | "strsim", 240 | "textwrap", 241 | "unicode-width", 242 | "vec_map", 243 | ] 244 | 245 | [[package]] 246 | name = "clicolors-control" 247 | version = "1.0.1" 248 | source = "registry+https://github.com/rust-lang/crates.io-index" 249 | checksum = "90082ee5dcdd64dc4e9e0d37fbf3ee325419e39c0092191e0393df65518f741e" 250 | dependencies = [ 251 | "atty", 252 | "lazy_static", 253 | "libc", 254 | "winapi", 255 | ] 256 | 257 | [[package]] 258 | name = "concurrent-queue" 259 | version = "1.2.2" 260 | source = "registry+https://github.com/rust-lang/crates.io-index" 261 | checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" 262 | dependencies = [ 263 | "cache-padded", 264 | ] 265 | 266 | [[package]] 267 | name = "console" 268 | version = "0.10.0" 269 | source = "registry+https://github.com/rust-lang/crates.io-index" 270 | checksum = "6728a28023f207181b193262711102bfbaf47cc9d13bc71d0736607ef8efe88c" 271 | dependencies = [ 272 | "clicolors-control", 273 | "encode_unicode", 274 | "lazy_static", 275 | "libc", 276 | "termios", 277 | "winapi", 278 | ] 279 | 280 | [[package]] 281 | name = "const_fn" 282 | version = "0.4.3" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "c478836e029dcef17fb47c89023448c64f781a046e0300e257ad8225ae59afab" 285 | 286 | [[package]] 287 | name = "crossbeam-channel" 288 | version = "0.3.9" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "c8ec7fcd21571dc78f96cc96243cab8d8f035247c3efd16c687be154c3fa9efa" 291 | dependencies = [ 292 | "crossbeam-utils 0.6.6", 293 | ] 294 | 295 | [[package]] 296 | name = "crossbeam-utils" 297 | version = "0.6.6" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6" 300 | dependencies = [ 301 | "cfg-if 0.1.10", 302 | "lazy_static", 303 | ] 304 | 305 | [[package]] 306 | name = "crossbeam-utils" 307 | version = "0.8.0" 308 | source = "registry+https://github.com/rust-lang/crates.io-index" 309 | checksum = "ec91540d98355f690a86367e566ecad2e9e579f230230eb7c21398372be73ea5" 310 | dependencies = [ 311 | "autocfg", 312 | "cfg-if 1.0.0", 313 | "const_fn", 314 | "lazy_static", 315 | ] 316 | 317 | [[package]] 318 | name = "curl" 319 | version = "0.4.28" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "eda1c0c03cacf3365d84818a40293f0e3f3953db8759c9c565a3b434edf0b52e" 322 | dependencies = [ 323 | "curl-sys", 324 | "libc", 325 | "openssl-probe", 326 | "openssl-sys", 327 | "schannel", 328 | "socket2 0.3.12", 329 | "winapi", 330 | ] 331 | 332 | [[package]] 333 | name = "curl-sys" 334 | version = "0.4.30+curl-7.69.1" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "923b38e423a8f47a4058e96f2a1fa2865a6231097ee860debd678d244277d50c" 337 | dependencies = [ 338 | "cc", 339 | "libc", 340 | "libnghttp2-sys", 341 | "libz-sys", 342 | "openssl-sys", 343 | "pkg-config", 344 | "vcpkg", 345 | "winapi", 346 | ] 347 | 348 | [[package]] 349 | name = "dtoa" 350 | version = "0.4.5" 351 | source = "registry+https://github.com/rust-lang/crates.io-index" 352 | checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" 353 | 354 | [[package]] 355 | name = "encode_unicode" 356 | version = "0.3.6" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" 359 | 360 | [[package]] 361 | name = "event-listener" 362 | version = "2.5.1" 363 | source = "registry+https://github.com/rust-lang/crates.io-index" 364 | checksum = "f7531096570974c3a9dcf9e4b8e1cede1ec26cf5046219fb3b9d897503b9be59" 365 | 366 | [[package]] 367 | name = "fastrand" 368 | version = "1.3.5" 369 | source = "registry+https://github.com/rust-lang/crates.io-index" 370 | checksum = "5c85295147490b8fcf2ea3d104080a105a8b2c63f9c319e82c02d8e952388919" 371 | 372 | [[package]] 373 | name = "fnv" 374 | version = "1.0.6" 375 | source = "registry+https://github.com/rust-lang/crates.io-index" 376 | checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" 377 | 378 | [[package]] 379 | name = "futures" 380 | version = "0.1.29" 381 | source = "registry+https://github.com/rust-lang/crates.io-index" 382 | checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" 383 | 384 | [[package]] 385 | name = "futures-channel" 386 | version = "0.3.5" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "f366ad74c28cca6ba456d95e6422883cfb4b252a83bed929c83abfdbbf2967d5" 389 | dependencies = [ 390 | "futures-core", 391 | ] 392 | 393 | [[package]] 394 | name = "futures-channel-preview" 395 | version = "0.3.0-alpha.19" 396 | source = "registry+https://github.com/rust-lang/crates.io-index" 397 | checksum = "d5e5f4df964fa9c1c2f8bddeb5c3611631cacd93baf810fc8bb2fb4b495c263a" 398 | dependencies = [ 399 | "futures-core-preview", 400 | "futures-sink-preview", 401 | ] 402 | 403 | [[package]] 404 | name = "futures-core" 405 | version = "0.3.5" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "59f5fff90fd5d971f936ad674802482ba441b6f09ba5e15fd8b39145582ca399" 408 | 409 | [[package]] 410 | name = "futures-core-preview" 411 | version = "0.3.0-alpha.19" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "b35b6263fb1ef523c3056565fa67b1d16f0a8604ff12b11b08c25f28a734c60a" 414 | 415 | [[package]] 416 | name = "futures-executor-preview" 417 | version = "0.3.0-alpha.19" 418 | source = "registry+https://github.com/rust-lang/crates.io-index" 419 | checksum = "75236e88bd9fe88e5e8bfcd175b665d0528fe03ca4c5207fabc028c8f9d93e98" 420 | dependencies = [ 421 | "futures-core-preview", 422 | "futures-util-preview", 423 | "num_cpus", 424 | ] 425 | 426 | [[package]] 427 | name = "futures-io" 428 | version = "0.3.5" 429 | source = "registry+https://github.com/rust-lang/crates.io-index" 430 | checksum = "de27142b013a8e869c14957e6d2edeef89e97c289e69d042ee3a49acd8b51789" 431 | 432 | [[package]] 433 | name = "futures-io-preview" 434 | version = "0.3.0-alpha.19" 435 | source = "registry+https://github.com/rust-lang/crates.io-index" 436 | checksum = "f4914ae450db1921a56c91bde97a27846287d062087d4a652efc09bb3a01ebda" 437 | 438 | [[package]] 439 | name = "futures-lite" 440 | version = "1.11.3" 441 | source = "registry+https://github.com/rust-lang/crates.io-index" 442 | checksum = "b4481d0cd0de1d204a4fa55e7d45f07b1d958abcb06714b3446438e2eff695fb" 443 | dependencies = [ 444 | "fastrand", 445 | "futures-core", 446 | "futures-io", 447 | "memchr", 448 | "parking", 449 | "pin-project-lite", 450 | "waker-fn", 451 | ] 452 | 453 | [[package]] 454 | name = "futures-preview" 455 | version = "0.3.0-alpha.19" 456 | source = "registry+https://github.com/rust-lang/crates.io-index" 457 | checksum = "3b1dce2a0267ada5c6ff75a8ba864b4e679a9e2aa44262af7a3b5516d530d76e" 458 | dependencies = [ 459 | "futures-channel-preview", 460 | "futures-core-preview", 461 | "futures-executor-preview", 462 | "futures-io-preview", 463 | "futures-sink-preview", 464 | "futures-util-preview", 465 | ] 466 | 467 | [[package]] 468 | name = "futures-sink-preview" 469 | version = "0.3.0-alpha.19" 470 | source = "registry+https://github.com/rust-lang/crates.io-index" 471 | checksum = "86f148ef6b69f75bb610d4f9a2336d4fc88c4b5b67129d1a340dd0fd362efeec" 472 | 473 | [[package]] 474 | name = "futures-util-preview" 475 | version = "0.3.0-alpha.19" 476 | source = "registry+https://github.com/rust-lang/crates.io-index" 477 | checksum = "5ce968633c17e5f97936bd2797b6e38fb56cf16a7422319f7ec2e30d3c470e8d" 478 | dependencies = [ 479 | "futures", 480 | "futures-channel-preview", 481 | "futures-core-preview", 482 | "futures-io-preview", 483 | "futures-sink-preview", 484 | "memchr", 485 | "pin-utils", 486 | "slab", 487 | "tokio-io", 488 | ] 489 | 490 | [[package]] 491 | name = "gloo-timers" 492 | version = "0.2.1" 493 | source = "registry+https://github.com/rust-lang/crates.io-index" 494 | checksum = "47204a46aaff920a1ea58b11d03dec6f704287d27561724a4631e450654a891f" 495 | dependencies = [ 496 | "futures-channel", 497 | "futures-core", 498 | "js-sys", 499 | "wasm-bindgen", 500 | "web-sys", 501 | ] 502 | 503 | [[package]] 504 | name = "hermit-abi" 505 | version = "0.1.9" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "0ebe6e23502442c4c9cd80fcb8bdf867dc5f4a9e9f1d882499fa49c5ed83e559" 508 | dependencies = [ 509 | "libc", 510 | ] 511 | 512 | [[package]] 513 | name = "http" 514 | version = "0.1.21" 515 | source = "registry+https://github.com/rust-lang/crates.io-index" 516 | checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" 517 | dependencies = [ 518 | "bytes", 519 | "fnv", 520 | "itoa", 521 | ] 522 | 523 | [[package]] 524 | name = "idna" 525 | version = "0.2.0" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 528 | dependencies = [ 529 | "matches", 530 | "unicode-bidi", 531 | "unicode-normalization", 532 | ] 533 | 534 | [[package]] 535 | name = "indicatif" 536 | version = "0.16.2" 537 | source = "registry+https://github.com/rust-lang/crates.io-index" 538 | checksum = "2d207dc617c7a380ab07ff572a6e52fa202a2a8f355860ac9c38e23f8196be1b" 539 | dependencies = [ 540 | "console", 541 | "lazy_static", 542 | "number_prefix", 543 | "regex", 544 | ] 545 | 546 | [[package]] 547 | name = "iovec" 548 | version = "0.1.4" 549 | source = "registry+https://github.com/rust-lang/crates.io-index" 550 | checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" 551 | dependencies = [ 552 | "libc", 553 | ] 554 | 555 | [[package]] 556 | name = "isahc" 557 | version = "0.7.6" 558 | source = "registry+https://github.com/rust-lang/crates.io-index" 559 | checksum = "17b77027f12e53ae59a379f7074259d32eb10867e6183388020e922832d9c3fb" 560 | dependencies = [ 561 | "bytes", 562 | "crossbeam-channel", 563 | "crossbeam-utils 0.6.6", 564 | "curl", 565 | "curl-sys", 566 | "futures-io-preview", 567 | "futures-util-preview", 568 | "http", 569 | "lazy_static", 570 | "log", 571 | "slab", 572 | "sluice", 573 | ] 574 | 575 | [[package]] 576 | name = "itoa" 577 | version = "0.4.5" 578 | source = "registry+https://github.com/rust-lang/crates.io-index" 579 | checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" 580 | 581 | [[package]] 582 | name = "js-sys" 583 | version = "0.3.41" 584 | source = "registry+https://github.com/rust-lang/crates.io-index" 585 | checksum = "c4b9172132a62451e56142bff9afc91c8e4a4500aa5b847da36815b63bfda916" 586 | dependencies = [ 587 | "wasm-bindgen", 588 | ] 589 | 590 | [[package]] 591 | name = "kv-log-macro" 592 | version = "1.0.7" 593 | source = "registry+https://github.com/rust-lang/crates.io-index" 594 | checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" 595 | dependencies = [ 596 | "log", 597 | ] 598 | 599 | [[package]] 600 | name = "lazy_static" 601 | version = "1.4.0" 602 | source = "registry+https://github.com/rust-lang/crates.io-index" 603 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 604 | 605 | [[package]] 606 | name = "libc" 607 | version = "0.2.93" 608 | source = "registry+https://github.com/rust-lang/crates.io-index" 609 | checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" 610 | 611 | [[package]] 612 | name = "libnghttp2-sys" 613 | version = "0.1.3" 614 | source = "registry+https://github.com/rust-lang/crates.io-index" 615 | checksum = "b359f5ec8106bc297694c9a562ace312be2cfd17a5fc68dc12249845aa144b11" 616 | dependencies = [ 617 | "cc", 618 | "libc", 619 | ] 620 | 621 | [[package]] 622 | name = "libz-sys" 623 | version = "1.0.25" 624 | source = "registry+https://github.com/rust-lang/crates.io-index" 625 | checksum = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" 626 | dependencies = [ 627 | "cc", 628 | "libc", 629 | "pkg-config", 630 | "vcpkg", 631 | ] 632 | 633 | [[package]] 634 | name = "log" 635 | version = "0.4.11" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 638 | dependencies = [ 639 | "cfg-if 0.1.10", 640 | ] 641 | 642 | [[package]] 643 | name = "matches" 644 | version = "0.1.8" 645 | source = "registry+https://github.com/rust-lang/crates.io-index" 646 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 647 | 648 | [[package]] 649 | name = "memchr" 650 | version = "2.3.3" 651 | source = "registry+https://github.com/rust-lang/crates.io-index" 652 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 653 | 654 | [[package]] 655 | name = "mime" 656 | version = "0.3.16" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 659 | 660 | [[package]] 661 | name = "mime_guess" 662 | version = "2.0.3" 663 | source = "registry+https://github.com/rust-lang/crates.io-index" 664 | checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" 665 | dependencies = [ 666 | "mime", 667 | "unicase", 668 | ] 669 | 670 | [[package]] 671 | name = "num_cpus" 672 | version = "1.13.0" 673 | source = "registry+https://github.com/rust-lang/crates.io-index" 674 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 675 | dependencies = [ 676 | "hermit-abi", 677 | "libc", 678 | ] 679 | 680 | [[package]] 681 | name = "number_prefix" 682 | version = "0.4.0" 683 | source = "registry+https://github.com/rust-lang/crates.io-index" 684 | checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" 685 | 686 | [[package]] 687 | name = "once_cell" 688 | version = "1.4.1" 689 | source = "registry+https://github.com/rust-lang/crates.io-index" 690 | checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad" 691 | 692 | [[package]] 693 | name = "openssl-probe" 694 | version = "0.1.2" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 697 | 698 | [[package]] 699 | name = "openssl-sys" 700 | version = "0.9.54" 701 | source = "registry+https://github.com/rust-lang/crates.io-index" 702 | checksum = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986" 703 | dependencies = [ 704 | "autocfg", 705 | "cc", 706 | "libc", 707 | "pkg-config", 708 | "vcpkg", 709 | ] 710 | 711 | [[package]] 712 | name = "parking" 713 | version = "2.0.0" 714 | source = "registry+https://github.com/rust-lang/crates.io-index" 715 | checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" 716 | 717 | [[package]] 718 | name = "percent-encoding" 719 | version = "2.1.0" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 722 | 723 | [[package]] 724 | name = "pin-project-lite" 725 | version = "0.2.6" 726 | source = "registry+https://github.com/rust-lang/crates.io-index" 727 | checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" 728 | 729 | [[package]] 730 | name = "pin-utils" 731 | version = "0.1.0" 732 | source = "registry+https://github.com/rust-lang/crates.io-index" 733 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 734 | 735 | [[package]] 736 | name = "pkg-config" 737 | version = "0.3.17" 738 | source = "registry+https://github.com/rust-lang/crates.io-index" 739 | checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" 740 | 741 | [[package]] 742 | name = "polling" 743 | version = "2.0.3" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "4fc12d774e799ee9ebae13f4076ca003b40d18a11ac0f3641e6f899618580b7b" 746 | dependencies = [ 747 | "cfg-if 1.0.0", 748 | "libc", 749 | "log", 750 | "wepoll-sys", 751 | "winapi", 752 | ] 753 | 754 | [[package]] 755 | name = "proc-macro2" 756 | version = "1.0.24" 757 | source = "registry+https://github.com/rust-lang/crates.io-index" 758 | checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" 759 | dependencies = [ 760 | "unicode-xid", 761 | ] 762 | 763 | [[package]] 764 | name = "quote" 765 | version = "1.0.3" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | checksum = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" 768 | dependencies = [ 769 | "proc-macro2", 770 | ] 771 | 772 | [[package]] 773 | name = "redox_syscall" 774 | version = "0.1.56" 775 | source = "registry+https://github.com/rust-lang/crates.io-index" 776 | checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" 777 | 778 | [[package]] 779 | name = "regex" 780 | version = "1.3.6" 781 | source = "registry+https://github.com/rust-lang/crates.io-index" 782 | checksum = "7f6946991529684867e47d86474e3a6d0c0ab9b82d5821e314b1ede31fa3a4b3" 783 | dependencies = [ 784 | "regex-syntax", 785 | ] 786 | 787 | [[package]] 788 | name = "regex-syntax" 789 | version = "0.6.17" 790 | source = "registry+https://github.com/rust-lang/crates.io-index" 791 | checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" 792 | 793 | [[package]] 794 | name = "rgh" 795 | version = "0.2.1" 796 | dependencies = [ 797 | "async-std", 798 | "clap", 799 | "indicatif", 800 | "serde", 801 | "serde_json", 802 | "surf", 803 | ] 804 | 805 | [[package]] 806 | name = "ryu" 807 | version = "1.0.3" 808 | source = "registry+https://github.com/rust-lang/crates.io-index" 809 | checksum = "535622e6be132bccd223f4bb2b8ac8d53cda3c7a6394944d3b2b33fb974f9d76" 810 | 811 | [[package]] 812 | name = "schannel" 813 | version = "0.1.18" 814 | source = "registry+https://github.com/rust-lang/crates.io-index" 815 | checksum = "039c25b130bd8c1321ee2d7de7fde2659fa9c2744e4bb29711cfc852ea53cd19" 816 | dependencies = [ 817 | "lazy_static", 818 | "winapi", 819 | ] 820 | 821 | [[package]] 822 | name = "serde" 823 | version = "1.0.126" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" 826 | dependencies = [ 827 | "serde_derive", 828 | ] 829 | 830 | [[package]] 831 | name = "serde_derive" 832 | version = "1.0.126" 833 | source = "registry+https://github.com/rust-lang/crates.io-index" 834 | checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" 835 | dependencies = [ 836 | "proc-macro2", 837 | "quote", 838 | "syn", 839 | ] 840 | 841 | [[package]] 842 | name = "serde_json" 843 | version = "1.0.64" 844 | source = "registry+https://github.com/rust-lang/crates.io-index" 845 | checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" 846 | dependencies = [ 847 | "itoa", 848 | "ryu", 849 | "serde", 850 | ] 851 | 852 | [[package]] 853 | name = "serde_urlencoded" 854 | version = "0.6.1" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" 857 | dependencies = [ 858 | "dtoa", 859 | "itoa", 860 | "serde", 861 | "url", 862 | ] 863 | 864 | [[package]] 865 | name = "signal-hook" 866 | version = "0.3.8" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "ef33d6d0cd06e0840fba9985aab098c147e67e05cee14d412d3345ed14ff30ac" 869 | dependencies = [ 870 | "libc", 871 | "signal-hook-registry", 872 | ] 873 | 874 | [[package]] 875 | name = "signal-hook-registry" 876 | version = "1.3.0" 877 | source = "registry+https://github.com/rust-lang/crates.io-index" 878 | checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" 879 | dependencies = [ 880 | "libc", 881 | ] 882 | 883 | [[package]] 884 | name = "slab" 885 | version = "0.4.2" 886 | source = "registry+https://github.com/rust-lang/crates.io-index" 887 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 888 | 889 | [[package]] 890 | name = "sluice" 891 | version = "0.4.2" 892 | source = "registry+https://github.com/rust-lang/crates.io-index" 893 | checksum = "0a7d06dfb3e8743bc19e6de8a302277471d08077d68946b307280496dc5a3531" 894 | dependencies = [ 895 | "futures-channel-preview", 896 | "futures-core-preview", 897 | "futures-io-preview", 898 | ] 899 | 900 | [[package]] 901 | name = "smallvec" 902 | version = "1.2.0" 903 | source = "registry+https://github.com/rust-lang/crates.io-index" 904 | checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" 905 | 906 | [[package]] 907 | name = "socket2" 908 | version = "0.3.12" 909 | source = "registry+https://github.com/rust-lang/crates.io-index" 910 | checksum = "03088793f677dce356f3ccc2edb1b314ad191ab702a5de3faf49304f7e104918" 911 | dependencies = [ 912 | "cfg-if 0.1.10", 913 | "libc", 914 | "redox_syscall", 915 | "winapi", 916 | ] 917 | 918 | [[package]] 919 | name = "socket2" 920 | version = "0.4.0" 921 | source = "registry+https://github.com/rust-lang/crates.io-index" 922 | checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" 923 | dependencies = [ 924 | "libc", 925 | "winapi", 926 | ] 927 | 928 | [[package]] 929 | name = "strsim" 930 | version = "0.8.0" 931 | source = "registry+https://github.com/rust-lang/crates.io-index" 932 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 933 | 934 | [[package]] 935 | name = "surf" 936 | version = "1.0.3" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "741a8008f8a833ef16f47df94a30754478fb2c2bf822b9c2e6f7f09203b97ace" 939 | dependencies = [ 940 | "futures-preview", 941 | "http", 942 | "isahc", 943 | "js-sys", 944 | "log", 945 | "mime", 946 | "mime_guess", 947 | "serde", 948 | "serde_json", 949 | "serde_urlencoded", 950 | "url", 951 | "wasm-bindgen", 952 | "wasm-bindgen-futures 0.3.27", 953 | "web-sys", 954 | ] 955 | 956 | [[package]] 957 | name = "syn" 958 | version = "1.0.64" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "3fd9d1e9976102a03c542daa2eff1b43f9d72306342f3f8b3ed5fb8908195d6f" 961 | dependencies = [ 962 | "proc-macro2", 963 | "quote", 964 | "unicode-xid", 965 | ] 966 | 967 | [[package]] 968 | name = "termios" 969 | version = "0.3.1" 970 | source = "registry+https://github.com/rust-lang/crates.io-index" 971 | checksum = "72b620c5ea021d75a735c943269bb07d30c9b77d6ac6b236bc8b5c496ef05625" 972 | dependencies = [ 973 | "libc", 974 | ] 975 | 976 | [[package]] 977 | name = "textwrap" 978 | version = "0.11.0" 979 | source = "registry+https://github.com/rust-lang/crates.io-index" 980 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 981 | dependencies = [ 982 | "unicode-width", 983 | ] 984 | 985 | [[package]] 986 | name = "tokio-io" 987 | version = "0.1.13" 988 | source = "registry+https://github.com/rust-lang/crates.io-index" 989 | checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" 990 | dependencies = [ 991 | "bytes", 992 | "futures", 993 | "log", 994 | ] 995 | 996 | [[package]] 997 | name = "unicase" 998 | version = "2.6.0" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 1001 | dependencies = [ 1002 | "version_check", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "unicode-bidi" 1007 | version = "0.3.4" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 1010 | dependencies = [ 1011 | "matches", 1012 | ] 1013 | 1014 | [[package]] 1015 | name = "unicode-normalization" 1016 | version = "0.1.12" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4" 1019 | dependencies = [ 1020 | "smallvec", 1021 | ] 1022 | 1023 | [[package]] 1024 | name = "unicode-width" 1025 | version = "0.1.7" 1026 | source = "registry+https://github.com/rust-lang/crates.io-index" 1027 | checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" 1028 | 1029 | [[package]] 1030 | name = "unicode-xid" 1031 | version = "0.2.0" 1032 | source = "registry+https://github.com/rust-lang/crates.io-index" 1033 | checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" 1034 | 1035 | [[package]] 1036 | name = "url" 1037 | version = "2.1.1" 1038 | source = "registry+https://github.com/rust-lang/crates.io-index" 1039 | checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb" 1040 | dependencies = [ 1041 | "idna", 1042 | "matches", 1043 | "percent-encoding", 1044 | ] 1045 | 1046 | [[package]] 1047 | name = "vcpkg" 1048 | version = "0.2.8" 1049 | source = "registry+https://github.com/rust-lang/crates.io-index" 1050 | checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" 1051 | 1052 | [[package]] 1053 | name = "vec-arena" 1054 | version = "1.0.0" 1055 | source = "registry+https://github.com/rust-lang/crates.io-index" 1056 | checksum = "eafc1b9b2dfc6f5529177b62cf806484db55b32dc7c9658a118e11bbeb33061d" 1057 | 1058 | [[package]] 1059 | name = "vec_map" 1060 | version = "0.8.1" 1061 | source = "registry+https://github.com/rust-lang/crates.io-index" 1062 | checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" 1063 | 1064 | [[package]] 1065 | name = "version_check" 1066 | version = "0.9.1" 1067 | source = "registry+https://github.com/rust-lang/crates.io-index" 1068 | checksum = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce" 1069 | 1070 | [[package]] 1071 | name = "waker-fn" 1072 | version = "1.1.0" 1073 | source = "registry+https://github.com/rust-lang/crates.io-index" 1074 | checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" 1075 | 1076 | [[package]] 1077 | name = "wasm-bindgen" 1078 | version = "0.2.64" 1079 | source = "registry+https://github.com/rust-lang/crates.io-index" 1080 | checksum = "6a634620115e4a229108b71bde263bb4220c483b3f07f5ba514ee8d15064c4c2" 1081 | dependencies = [ 1082 | "cfg-if 0.1.10", 1083 | "wasm-bindgen-macro", 1084 | ] 1085 | 1086 | [[package]] 1087 | name = "wasm-bindgen-backend" 1088 | version = "0.2.64" 1089 | source = "registry+https://github.com/rust-lang/crates.io-index" 1090 | checksum = "3e53963b583d18a5aa3aaae4b4c1cb535218246131ba22a71f05b518098571df" 1091 | dependencies = [ 1092 | "bumpalo", 1093 | "lazy_static", 1094 | "log", 1095 | "proc-macro2", 1096 | "quote", 1097 | "syn", 1098 | "wasm-bindgen-shared", 1099 | ] 1100 | 1101 | [[package]] 1102 | name = "wasm-bindgen-futures" 1103 | version = "0.3.27" 1104 | source = "registry+https://github.com/rust-lang/crates.io-index" 1105 | checksum = "83420b37346c311b9ed822af41ec2e82839bfe99867ec6c54e2da43b7538771c" 1106 | dependencies = [ 1107 | "cfg-if 0.1.10", 1108 | "futures", 1109 | "futures-channel-preview", 1110 | "futures-util-preview", 1111 | "js-sys", 1112 | "lazy_static", 1113 | "wasm-bindgen", 1114 | "web-sys", 1115 | ] 1116 | 1117 | [[package]] 1118 | name = "wasm-bindgen-futures" 1119 | version = "0.4.14" 1120 | source = "registry+https://github.com/rust-lang/crates.io-index" 1121 | checksum = "dba48d66049d2a6cc8488702e7259ab7afc9043ad0dc5448444f46f2a453b362" 1122 | dependencies = [ 1123 | "cfg-if 0.1.10", 1124 | "js-sys", 1125 | "wasm-bindgen", 1126 | "web-sys", 1127 | ] 1128 | 1129 | [[package]] 1130 | name = "wasm-bindgen-macro" 1131 | version = "0.2.64" 1132 | source = "registry+https://github.com/rust-lang/crates.io-index" 1133 | checksum = "3fcfd5ef6eec85623b4c6e844293d4516470d8f19cd72d0d12246017eb9060b8" 1134 | dependencies = [ 1135 | "quote", 1136 | "wasm-bindgen-macro-support", 1137 | ] 1138 | 1139 | [[package]] 1140 | name = "wasm-bindgen-macro-support" 1141 | version = "0.2.64" 1142 | source = "registry+https://github.com/rust-lang/crates.io-index" 1143 | checksum = "9adff9ee0e94b926ca81b57f57f86d5545cdcb1d259e21ec9bdd95b901754c75" 1144 | dependencies = [ 1145 | "proc-macro2", 1146 | "quote", 1147 | "syn", 1148 | "wasm-bindgen-backend", 1149 | "wasm-bindgen-shared", 1150 | ] 1151 | 1152 | [[package]] 1153 | name = "wasm-bindgen-shared" 1154 | version = "0.2.64" 1155 | source = "registry+https://github.com/rust-lang/crates.io-index" 1156 | checksum = "7f7b90ea6c632dd06fd765d44542e234d5e63d9bb917ecd64d79778a13bd79ae" 1157 | 1158 | [[package]] 1159 | name = "web-sys" 1160 | version = "0.3.37" 1161 | source = "registry+https://github.com/rust-lang/crates.io-index" 1162 | checksum = "2d6f51648d8c56c366144378a33290049eafdd784071077f6fe37dae64c1c4cb" 1163 | dependencies = [ 1164 | "js-sys", 1165 | "wasm-bindgen", 1166 | ] 1167 | 1168 | [[package]] 1169 | name = "wepoll-sys" 1170 | version = "3.0.1" 1171 | source = "registry+https://github.com/rust-lang/crates.io-index" 1172 | checksum = "0fcb14dea929042224824779fbc82d9fab8d2e6d3cbc0ac404de8edf489e77ff" 1173 | dependencies = [ 1174 | "cc", 1175 | ] 1176 | 1177 | [[package]] 1178 | name = "winapi" 1179 | version = "0.3.9" 1180 | source = "registry+https://github.com/rust-lang/crates.io-index" 1181 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1182 | dependencies = [ 1183 | "winapi-i686-pc-windows-gnu", 1184 | "winapi-x86_64-pc-windows-gnu", 1185 | ] 1186 | 1187 | [[package]] 1188 | name = "winapi-i686-pc-windows-gnu" 1189 | version = "0.4.0" 1190 | source = "registry+https://github.com/rust-lang/crates.io-index" 1191 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1192 | 1193 | [[package]] 1194 | name = "winapi-x86_64-pc-windows-gnu" 1195 | version = "0.4.0" 1196 | source = "registry+https://github.com/rust-lang/crates.io-index" 1197 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1198 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "rgh" 3 | version = "0.2.1" 4 | authors = ["k-nasa "] 5 | repository = "https://github.com/k-nasa/rgh" 6 | keywords = ["cli", "rgh", "github"] 7 | categories = ["command-line-utilities"] 8 | description = "Creates GitHub release and upload asset files" 9 | readme = "README.md" 10 | license = "MIT" 11 | edition = "2018" 12 | 13 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 14 | 15 | [dependencies] 16 | async-std = { version = "1.10.0", features = ["unstable"] } 17 | clap = "2.34.0" 18 | serde = { version = "1.0.126", features = ["derive"] } 19 | serde_json = "1.0.64" 20 | surf = "1.0.3" 21 | indicatif = "0.16.2" 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 nasa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # x86_64-unknown-linux-gnu 2 | # x86_64-apple-darwin 3 | # x86_64-pc-windows-gnu 4 | 5 | TARGET:= x86_64-pc-windows-gnu 6 | BIN_NAME:=rgh.exe 7 | CRATE_NAME:=rgh 8 | MISC:= README.md LICENSE 9 | DIRNAME:=${CRATE_NAME}_${TARGET} 10 | 11 | release_all: 12 | rm -rf dist/ 13 | make release TARGET=x86_64-pc-windows-gnu BIN_NAME=rgh.exe 14 | make release TARGET=x86_64-apple-darwin BIN_NAME=rgh 15 | make release TARGET=x86_64-unknown-linux-gnu BIN_NAME=rgh 16 | 17 | .PHONY: release 18 | release: 19 | cross build --target ${TARGET} --release 20 | mkdir -p ${DIRNAME} 21 | \ 22 | cp ./target/${TARGET}/release/${BIN_NAME} ${DIRNAME} 23 | cp ${MISC} ${DIRNAME} 24 | \ 25 | mkdir -p dist 26 | tar czf dist/${DIRNAME}.tar.gz ${DIRNAME} 27 | rm -rf ${DIRNAME} 28 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rgh 2 | 3 | ## Overview 4 | 5 | [![Actions Status](https://github.com/k-nasa/rgh/workflows/CI/badge.svg)](https://github.com/k-nasa/rgh/actions) 6 | [![crate-name at crates.io](https://img.shields.io/crates/v/rgh.svg)](https://crates.io/crates/rgh) 7 | 8 | Creates GitHub release and upload asset files 9 | 10 | ## Demo 11 | 12 | ![Demo](https://user-images.githubusercontent.com/23740172/68768822-9ab1dd00-0666-11ea-9bc3-469333fde310.gif) 13 | 14 | ## Installation 15 | 16 | ### Pre-compiled executables 17 | 18 | Get them [here](https://github.com/k-nasa/rgh/releases) 19 | 20 | ### using homebrew 21 | 22 | ``` 23 | brew install k-nasa/tap/rgh 24 | ``` 25 | 26 | ### using cargo 27 | 28 | Currently it cannot be built with the stable version. 29 | 30 | ``` 31 | cargo +beta install rgh 32 | ``` 33 | 34 | ##### Installation of cargo itself. 35 | 36 | ``` 37 | curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh 38 | ``` 39 | 40 | ## Usage 41 | 42 | ``` 43 | rgh 0.1.0 44 | Creates GitHub release and upload asset files 45 | 46 | USAGE: 47 | rgh [OPTIONS] 48 | 49 | FLAGS: 50 | -h, --help Prints help information 51 | -V, --version Prints version information 52 | 53 | OPTIONS: 54 | --commit Specifies the commitish value that determines where the Git tag is created from. 55 | Can be any branch or commit SHA. Unused if the Git tag already exists. Default: 56 | the repository's default branch (usually master). 57 | -t, --token Set Github API Token (By default reads the GITHUB_TOKEN environment variable) 58 | --title The title of the release 59 | -b, --body Text describing the contents of the tag. 60 | --draft [possible values: true, false] 61 | --prerelease [possible values: true, false] 62 | 63 | ARGS: 64 | tag 65 | upload packages dir or file 66 | ``` 67 | 68 | ## Contribution 69 | 70 | 1. Fork it ( http://github.com/k-nasa/rgh ) 71 | 2. Create your feature branch (git checkout -b my-new-feature) 72 | 3. Commit your changes (git commit -am 'Add some feature') 73 | 4. Push to the branch (git push origin my-new-feature) 74 | 5. Create new Pull Request 75 | 76 | ## Licence 77 | 78 | [MIT](https://github.com/k-nasa/rgh/blob/master/LICENCE) 79 | 80 | ## Author 81 | 82 | [k-nasa](https://github.com/k-nasa) 83 | 84 | [my website](https://k-nasa.me) 85 | -------------------------------------------------------------------------------- /assets/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/k-nasa/rgh/0c96dcd9bd937660acb758f7a25835b7d4b9ab25/assets/demo.gif -------------------------------------------------------------------------------- /src/github.rs: -------------------------------------------------------------------------------- 1 | use async_std::path::Path; 2 | use serde::{Deserialize, Serialize}; 3 | use surf::url; 4 | 5 | use crate::RghResult; 6 | 7 | #[derive(Deserialize, Serialize)] 8 | pub struct RequestCrateRelease { 9 | pub tag_name: String, 10 | pub target_commitish: String, 11 | pub name: String, 12 | pub body: String, 13 | pub draft: bool, 14 | pub prerelease: bool, 15 | } 16 | 17 | #[derive(Deserialize, Serialize)] 18 | pub struct ResponseCreateRelease { 19 | pub id: usize, 20 | } 21 | 22 | pub async fn create_release( 23 | owner: &str, 24 | repo: &str, 25 | token: &str, 26 | arg: RequestCrateRelease, 27 | ) -> RghResult { 28 | let token = format!("token {}", token); 29 | let url = format!("https://api.github.com/repos/{}/{}/releases", owner, repo); 30 | 31 | let mut res = surf::post(url) 32 | .set_header("Authorization", &token) 33 | .body_json(&arg)? 34 | .await?; 35 | 36 | if res.status() != 201 { 37 | let e = res.body_string().await?; 38 | return Err(Box::new(std::io::Error::new( 39 | std::io::ErrorKind::Other, 40 | format!("Failed create_release: response is {}", e), 41 | ))); 42 | } 43 | 44 | Ok(serde_json::from_str(&res.body_string().await?)?) 45 | } 46 | 47 | pub async fn upload_asset( 48 | owner: &str, 49 | repo: &str, 50 | token: &str, 51 | release_id: usize, 52 | filepath: &str, 53 | ) -> RghResult<()> { 54 | let bytes = async_std::fs::read(filepath).await?.len(); 55 | 56 | let filename = Path::new(filepath).file_name().unwrap(); 57 | 58 | let url = format!( 59 | "https://uploads.github.com/repos/{}/{}/releases/{}/assets?name={:?}", 60 | owner, repo, release_id, filename, 61 | ); 62 | let url = url::Url::parse(&url)?; 63 | 64 | let token = format!("token {}", token); 65 | let bytes = format!("{}", bytes); 66 | 67 | let mut res = surf::post(url) 68 | .set_header("Authorization", &token) 69 | .set_header("content-length", &bytes) 70 | .body_file(filepath)? 71 | .await?; 72 | 73 | if res.status() != 201 { 74 | let e = res.body_string().await?; 75 | return Err(Box::new(std::io::Error::new( 76 | std::io::ErrorKind::Other, 77 | format!("Failed upload_assets: response is {}", e), 78 | ))); 79 | } 80 | 81 | Ok(()) 82 | } 83 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod github; 2 | 3 | use github::{create_release, upload_asset, RequestCrateRelease}; 4 | 5 | use std::process::Command; 6 | use std::str::FromStr; 7 | use std::sync::Arc; 8 | 9 | use async_std::fs; 10 | use async_std::path::Path; 11 | use async_std::prelude::*; 12 | use async_std::task; 13 | use clap::{crate_description, crate_name, crate_version, App, AppSettings, Arg}; 14 | use indicatif::{ProgressBar, ProgressStyle}; 15 | 16 | type RghResult = std::result::Result; 17 | type RghError = Box; 18 | 19 | fn main() -> RghResult<()> { 20 | let app = build_app(); 21 | 22 | let matches = app.get_matches(); 23 | 24 | let tag_name = matches.value_of("tag").unwrap().to_owned(); 25 | let pkg = matches.value_of("packages").unwrap().to_owned(); 26 | 27 | let (owner, repo) = read_gitconfig()?; 28 | 29 | let token = if let Some(token) = matches.value_of("token") { 30 | token.to_string() 31 | } else { 32 | match std::env::var("GITHUB_TOKEN") { 33 | Ok(t) => t, 34 | Err(_) => { 35 | println!("GITHUB_TOKEN is not setted"); 36 | println!("Please set it via `GITHUB_TOKEN` env variable or `-t` option"); 37 | std::process::exit(1); 38 | } 39 | } 40 | }; 41 | let draft = bool::from_str(matches.value_of("draft").unwrap_or("false"))?; 42 | let prerelease = bool::from_str(matches.value_of("prerelease").unwrap_or("false"))?; 43 | 44 | let request = RequestCrateRelease { 45 | tag_name, 46 | target_commitish: matches 47 | .value_of("target_commitish") 48 | .unwrap_or_default() 49 | .to_owned(), 50 | name: matches.value_of("name").unwrap_or_default().to_owned(), 51 | body: matches.value_of("body").unwrap_or_default().to_owned(), 52 | draft, 53 | prerelease, 54 | }; 55 | 56 | let result: RghResult<()> = task::block_on(async move { 57 | let r = create_release(&owner, &repo, &token, request).await?; 58 | 59 | let path = Path::new(&pkg); 60 | 61 | if path.is_file().await { 62 | upload_asset(&owner, &repo, &token, r.id, &pkg).await?; 63 | } else if path.is_dir().await { 64 | let mut dir = fs::read_dir(pkg).await?; 65 | 66 | let owner = Arc::new(owner); 67 | let repo = Arc::new(repo); 68 | let token = Arc::new(token); 69 | let r = Arc::new(r); 70 | 71 | let mut futures = vec![]; 72 | 73 | while let Some(res) = dir.next().await { 74 | let entry = res?; 75 | if entry.path().is_file().await { 76 | let owner = owner.clone(); 77 | let repo = repo.clone(); 78 | let r = r.clone(); 79 | let token = token.clone(); 80 | 81 | futures.push(task::spawn(async move { 82 | println!("uploading {:?}", entry.path().into_os_string()); 83 | upload_asset(&owner, &repo, &token, r.id, &entry.path().to_str().unwrap()) 84 | .await 85 | })); 86 | } 87 | } 88 | 89 | let pb = ProgressBar::new(futures.iter().count() as u64); 90 | let mut position = 0; 91 | pb.set_style( 92 | ProgressStyle::default_bar() 93 | .template( 94 | "{spinner:.green} [{elapsed_precise}] [{bar:40.cyan/blue}] {percent}% ({eta})", 95 | ) 96 | .progress_chars("#>-"), 97 | ); 98 | pb.finish_with_message("finished"); 99 | 100 | for f in futures { 101 | position += 1; 102 | pb.set_position(position); 103 | if let Err(e) = f.await { 104 | println!("failed upload file: {}", e) 105 | } 106 | } 107 | } 108 | Ok(()) 109 | }); 110 | 111 | match result { 112 | Ok(_) => (), 113 | Err(e) => { 114 | eprintln!("{}", e); 115 | std::process::exit(1); 116 | } 117 | } 118 | 119 | Ok(()) 120 | } 121 | 122 | // TODO let outputを外に括りだしてテストコードを書く 123 | fn read_gitconfig() -> RghResult<(String, String)> { 124 | let output = Command::new("git") 125 | .arg("config") 126 | .arg("--get") 127 | .arg("remote.origin.url") 128 | .output() 129 | .expect("Failed run git config command"); 130 | 131 | let origin_url = std::str::from_utf8(&output.stdout)?.trim(); 132 | 133 | let owner = origin_url 134 | .split('/') 135 | .nth(3) 136 | .ok_or_else(|| "Reading of origin url failed")?; 137 | 138 | let repo = origin_url 139 | .split('/') 140 | .nth(4) 141 | .ok_or_else(|| "Reading of origin url failed")? 142 | .trim_end_matches(".git"); 143 | 144 | Ok((owner.to_owned(), repo.to_owned())) 145 | } 146 | 147 | fn build_app() -> App<'static, 'static> { 148 | App::new(crate_name!()) 149 | .version(crate_version!()) 150 | .about(crate_description!()) 151 | .setting(AppSettings::DeriveDisplayOrder) 152 | .setting(AppSettings::ColoredHelp) 153 | .args(&[ 154 | Arg::with_name("tag").help("tag").required(true), 155 | Arg::with_name("packages") 156 | .help("upload packages dir or file") 157 | .required(true), 158 | ]) 159 | .arg( 160 | Arg::with_name("commit") 161 | .help("Specifies the commitish value that determines where the Git tag is created from. Can be any branch or commit SHA. Unused if the Git tag already exists. Default: the repository's default branch (usually master).") 162 | .long("commit") 163 | .value_name("target-commitish"), 164 | ) 165 | .arg( 166 | Arg::with_name("token") 167 | .help("Set Github API Token (By default reads the GITHUB_TOKEN environment variable)") 168 | .long("token") 169 | .short("t") 170 | .value_name("token"), 171 | ) 172 | .arg( 173 | Arg::with_name("title") 174 | .help("The title of the release") 175 | .long("title") 176 | .value_name("name"), 177 | ) 178 | .arg( 179 | Arg::with_name("body") 180 | .help("Text describing the contents of the tag.") 181 | .long("body") 182 | .short("b") 183 | .value_name("body"), 184 | ) 185 | .arg( 186 | Arg::with_name("draft") 187 | .long("draft") 188 | .value_name("draft") 189 | .possible_values(&["true", "false"]) 190 | ) 191 | .arg( 192 | Arg::with_name("prerelease") 193 | .long("prerelease") 194 | .value_name("prerelease") 195 | .possible_values(&["true", "false"]) 196 | ) 197 | } 198 | --------------------------------------------------------------------------------