Commit 67c6890
authored
C# HTTP handlers - Module Bindings (#5024)
# Description of Changes
Adding C# HTTP handlers based on #4636
- adds the C# handler/router API `[SpacetimeDB.HttpHandler]`,
`[SpacetimeDB.HttpRouter]`
- wires C# HTTP handlers into module definition/build/runtime
registration
- mirrors the Rust/TypeScript HTTP smoketests and adds C# docs coverage
- updates the HTTP handlers docs with C# examples
- refactored ProcedureContext to allow for a central location for
WithTx/TryWithTx to support HandlerContext
- routes use a generated `Handlers.*` tokens to avoid raw strings
# API and ABI breaking changes
Adds new APIs for the HTTP handler and should not be breaking
# Expected complexity level and risk
3 - this hit the binding, module registration, and had a decent refactor
for ProcedureContext
# Testing
- [x] Expanded `crates/smoketests/tests/smoketests/http_routes.rs` with
C# mirrors of the Rust HTTP
route tests
I also did some manual testing with a throw away project, and will be
adding to the `module-test` after all languages are caught up on HTTP
handlers.1 parent cadc224 commit 67c6890
18 files changed
Lines changed: 2026 additions & 262 deletions
File tree
- crates
- bindings-csharp
- Codegen.Tests/fixtures
- diag/snapshots
- explicitnames/snapshots
- server/snapshots
- Codegen
- Runtime.Tests
- Runtime
- Internal
- smoketests/tests/smoketests
- docs/docs/00200-core-concepts/00200-functions
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 72 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
| |||
210 | 212 | | |
211 | 213 | | |
212 | 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 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
213 | 255 | | |
214 | 256 | | |
215 | 257 | | |
| |||
219 | 261 | | |
220 | 262 | | |
221 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
222 | 273 | | |
223 | 274 | | |
224 | 275 | | |
| |||
560 | 611 | | |
561 | 612 | | |
562 | 613 | | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
563 | 617 | | |
564 | 618 | | |
565 | 619 | | |
| |||
635 | 689 | | |
636 | 690 | | |
637 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
638 | 710 | | |
639 | 711 | | |
640 | 712 | | |
| |||
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
489 | 489 | | |
490 | 490 | | |
491 | 491 | | |
| 492 | + | |
| 493 | + | |
492 | 494 | | |
493 | 495 | | |
494 | 496 | | |
| |||
652 | 654 | | |
653 | 655 | | |
654 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
655 | 697 | | |
656 | 698 | | |
657 | 699 | | |
| |||
661 | 703 | | |
662 | 704 | | |
663 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
664 | 715 | | |
665 | 716 | | |
666 | 717 | | |
| |||
2450 | 2501 | | |
2451 | 2502 | | |
2452 | 2503 | | |
| 2504 | + | |
| 2505 | + | |
| 2506 | + | |
2453 | 2507 | | |
2454 | 2508 | | |
2455 | 2509 | | |
| |||
2499 | 2553 | | |
2500 | 2554 | | |
2501 | 2555 | | |
| 2556 | + | |
2502 | 2557 | | |
2503 | 2558 | | |
2504 | 2559 | | |
| |||
2562 | 2617 | | |
2563 | 2618 | | |
2564 | 2619 | | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| 2623 | + | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
| 2635 | + | |
| 2636 | + | |
| 2637 | + | |
2565 | 2638 | | |
2566 | 2639 | | |
2567 | 2640 | | |
| |||
0 commit comments