-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create and generate template from template data for teams (#238)
* create and generate template from template data * add supports semantic patch to template and data * fix test * fix more tests * update template
- Loading branch information
1 parent
f7bf857
commit bf2f0a1
Showing
17 changed files
with
748 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// This file is generated by gen_resources.go; DO NOT EDIT. | ||
|
||
package resources | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"ldcli/internal/analytics" | ||
"ldcli/internal/resources" | ||
) | ||
|
||
func AddAllResourceCmds(rootCmd *cobra.Command, client resources.Client, analyticsTracker analytics.Tracker) { | ||
// Resource commands | ||
{{ range $resName, $resData := .Resources }} | ||
gen_{{ $resName }}ResourceCmd := NewResourceCmd( | ||
rootCmd, | ||
analyticsTracker, | ||
"{{ $resData.Name }}", | ||
"Make requests (list, create, etc.) on {{ $resData.DisplayName }}", | ||
{{ $resData.Description }}, | ||
) | ||
{{ end }} | ||
|
||
// Operation commands | ||
{{ range $resName, $resData := .Resources }}{{ range $opName, $opData := $resData.Operations }} | ||
NewOperationCmd(gen_{{ $resName }}ResourceCmd, client, OperationData{ | ||
Short: {{ $opData.Short }}, | ||
Long: {{ $opData.Long }}, | ||
Use: "{{ $opData.Use }}", | ||
Params: []Param{ {{ range $param := $opData.Params }} | ||
{ | ||
Name: "{{ $param.Name }}", | ||
In: "{{ $param.In }}", | ||
Description: {{ $param.Description }}, | ||
Type: "{{ $param.Type }}", | ||
}, {{ end }} | ||
}, | ||
HTTPMethod: "{{ $opData.HTTPMethod }}", | ||
RequiresBody: {{ $opData.RequiresBody }}, | ||
Path: "{{ $opData.Path }}", | ||
SupportsSemanticPatch: {{ $opData.SupportsSemanticPatch }}, | ||
}) | ||
|
||
{{ end }}{{ end }} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.