We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
For example, the current way to create a new node of Ali-cloud is:
alicloud, _ := gocloud.CloudProvider(gocloud.Aliprovider) create := map[string]interface{}{ "RegionId": "cn-qingdao", "ImageId": "centos_7_04_64_20G_alibase_201701015.vhd", "InstanceType": "ecs.xn4.small", "SecurityGroupId": "sg-m5egbo9s5xb21kpu6nk2", } resp, err := alicloud.Createnode(create)
In the current way, we cannot prevent user from entering wrong parameter name and missing required parameters.
If we use Builder pattern like this:
alicloud, _ := gocloud.CloudProvider(gocloud.Aliprovider) createNodeBuilder := ecs.NewCreateNodeBuilder(). RegionID("cn-qingdao"). ImageID("centos_7_04_64_20G_alibase_201701015.vhd"). InstanceType("ecs.xn4.small"). SecurityGroupID("sg-m5egbo9s5xb21kpu6nk2") createNode, err := createNodeBuilder.Build() if err != nil { // May miss required parameters } resp, err := alicloud.Createnode(createNode)
We can
The text was updated successfully, but these errors were encountered:
I second this suggestion.
Sorry, something went wrong.
this is good suggestion one we cover all cloud providers we can do this in gocloud 2.0
+1
@PratikDhanave That's great!
No branches or pull requests
For example, the current way to create a new node of Ali-cloud is:
The Problem
In the current way, we cannot prevent user from entering wrong parameter name and missing required parameters.
Suggestion
If we use Builder pattern like this:
We can
The text was updated successfully, but these errors were encountered: