-
Notifications
You must be signed in to change notification settings - Fork 25
Conversation
2fa56e4
to
6d84725
Compare
This commit implements the `cargo func new` command. The command adds a new Azure function to the project based upon a built-in template. The following kind of functions can be added: * HTTP triggered * Blob triggered * Queue triggered * Timer triggered
This commit updates the `create_function` calls for the `cargo func new` command so that they are easier to understand.
This commit ensures that we only use a single copy of a template rather than read and store the template as a static string in multiple places.
@rylev Ok, this should be less cluttered for a review. Thanks! |
|
||
let expanded = quote! { | ||
&[#(&#funcs),*] | ||
#(mod #mods;)* | ||
pub const FUNCTIONS: &[&::azure_functions::codegen::Function] = &[#(&#funcs),*]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if codegen
wasn't even available on azure_functions
. I still like the idea of changing azure_functions
to re-export Function
. I know this isn't directly visible by the user, but it could cause confusion later on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a lot more exposed than just Function
. #[func]
generates a lot of code that uses codegen
that is dependent upon which bindings are being used.
Yeah, it'd be nice if users couldn't see the "behind the curtain" module, but I'd prefer not to pollute the root with a bunch of types that users will never use directly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's fair. I think it's something to keep an eye on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️🦀
This commit implements the
cargo func new
command.The command adds a new Azure function to the project based upon a
built-in template.
The following kind of functions can be added: