Skip to content
This repository has been archived by the owner on Jun 2, 2020. It is now read-only.

Implement the cargo func new command. #145

Merged
merged 3 commits into from
Feb 11, 2019
Merged

Implement the cargo func new command. #145

merged 3 commits into from
Feb 11, 2019

Conversation

peterhuene
Copy link
Owner

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

@peterhuene peterhuene added this to the 0.4.0 milestone Feb 9, 2019
@peterhuene peterhuene requested a review from rylev February 9, 2019 08:42
@cla-bot cla-bot bot added the cla-signed The CLA has been signed by the contributor. label Feb 9, 2019
Peter Huene added 3 commits February 11, 2019 06:36
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.
@peterhuene
Copy link
Owner Author

@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),*];
Copy link
Collaborator

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.

Copy link
Owner Author

@peterhuene peterhuene Feb 11, 2019

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.

Copy link
Collaborator

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.

Copy link
Collaborator

@rylev rylev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️🦀

@peterhuene peterhuene merged commit b2b8b03 into master Feb 11, 2019
@peterhuene peterhuene deleted the sdk branch February 11, 2019 15:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla-signed The CLA has been signed by the contributor.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants