generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Go helper functions for HttpResponse (#2622)
`builtin/external_module.go` will have a couple of helper functions added: ``` // A helper for successful HttpResponse // func HttpSuccess[E any, B any](code int, body B) HttpResponse[B, E] { return HttpResponse[B, E]{Status: code, Body: ftl.Some(body)} } // A helper for HttpResponse with error // func HttpError[B any, E any](code int, e E) HttpResponse[B, E] { return HttpResponse[B, E]{Status: code, Error: ftl.Some(e)} } ``` Fixes: #1632
- Loading branch information
1 parent
4f4ca4e
commit a48978d
Showing
2 changed files
with
17 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters