Replies: 2 comments 11 replies
-
@redecs @rizerkrof @dylanhitt @qbit I really need the input of everyone here, if you have time |
Beta Was this translation helpful? Give feedback.
11 replies
-
I believe this can be closed? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
RFC fuego-174 New variadic syntax for route declaration and parameters
Current problem
The chaining syntax have at least 4 serious limits.
HTTPHandler
(serve.go
) after it is registered (might just need a PR from someone wiser than me but it seems tricky honestly)Header
,Description
...) have withRoute[Body, Return]
as receiver, so users cannot add their custom behaviour.Proposition
Using the
...func(*Options)
"variadic options" pattern might be an elegant solution to it.option.Group
, I have an implementation)c.QueryParam()
does not contains a typo or wrong informationOther solution
Another solution would be using #119 and embedding. I would like to try something else. Sure, with this proposal, we will not enjoy some compile-time checks, but:
Context*
structsAuthorization string 'header:"Autorisation"'
and make typos anyway, thus catching nothing at runtime. The variadic options would enable parameters validation and/or warnings at runtime.Limits
fuego.Description
is not very "discoverable". I don't like maintaining documentation and want the users to be able to discover Fuego behaviour from their IDE. For*Server options
, we usedfuego.WithXxx
syntax. This allow users to know that everyfuego.WithXxx
is a Server option and enabled them to discover new options easily by typingfuego.With<Tab>
or looking at all the functions starting byWith
in the docs. I would like to do the same thing here, but it hurts readability. What should we do? I think of 2 solutionsfuego.OptDescription("My controller does this")
) - uglyoption
(example:option.Description("My controller does this")
) only used for description - how the user would figure that the option package exists ? We can maybe spam it in the docs?Beta Was this translation helpful? Give feedback.
All reactions