E2E List cmd and added API calls (#3)

* Completed List cmd and added API calls

* Minor comments and add delete code to pass linting

* Typo in descriptions

* Minor comments

* Validations

* Validations-1

* improved branch flag validation

* removed build

* Minor comments and Readme
This commit is contained in:
Deepak Dahiya
2022-06-22 15:23:55 +05:30
committed by GitHub
parent 60b70e6320
commit 08af75f371
7 changed files with 257 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
package cmd
import (
"fmt"
"log"
"github.com/spf13/cobra"
)
@@ -18,11 +18,17 @@ var deleteCmd = &cobra.Command{
Short: "Delete cache by key",
Long: `Delete cache by key`,
Run: func(cmd *cobra.Command, args []string) {
repo, _ := cmd.Flags().GetString("repo")
COMMAND = "delete"
r, _ := cmd.Flags().GetString("repo")
branch, _ := cmd.Flags().GetString("branch")
fmt.Println("DELETE")
fmt.Println(repo)
fmt.Println(branch)
repo, err := getRepo(r)
if err != nil {
log.Fatal(err)
}
queryParams := generateQueryParams(branch, 30, "", "", "")
deleteCaches(repo, queryParams)
},
}