#You and Kyle did all the work there...

1 messages ยท Page 1 of 1 (latest)

cedar scaffold
#

All else being equal, it's nicer to have a lot of parameters rather than one single parameter that points to a separate config since parameters show up as part of the Function's schema and thus give any callers nice type-checking when invoking the Function.

However, it's definitely annoying to have to write a ton of parameters to a go function (and IIRC there's some relatively low limit imposed by the go compiler).

#

One other option is to use a builder pattern to allow users to configure parameters one-at-a-time. These are the With* you'll see some other modules using. I'm looking for a good example...

#

There's also going to be another option available soon thanks to this PR from @drowsy rivet, which will allow you to accept custom structs as inputs to functions https://github.com/dagger/dagger/pull/6102

That should allow you to group parameters together in a struct rather than make them all direct parameters to the function.

ebon mauve
ebon mauve
#

good points about the parameter visibility and type checking. at some point the visibility suffers when you have way too many parameters where everything gets lost ๐Ÿ™‚ really appreciate your pointers

true drift
#

@lost pawn ๐Ÿ‘‹

lost pawn
#

Thanks @true drift ! We are in contact now and @ebon mauve graciously agreed to demo it tomorrow during the community call ๐Ÿ™‚

true drift
#

Sweet!

ebon mauve
#

all good ๐Ÿ™‚