Skip to content
Snippets Groups Projects
Commit 7ab6e3f5 authored by Malte Bauch's avatar Malte Bauch
Browse files

renamed cli/http.go HttpGet function to HTTPGet

parent 35af96dc
No related branches found
No related tags found
2 merge requests!120Resolve "Code Quality",!90Develop
...@@ -69,8 +69,8 @@ func TestHttpGet(t *testing.T) { ...@@ -69,8 +69,8 @@ func TestHttpGet(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
if err := HttpGet(tt.args.apiEndpoint, tt.args.f, tt.args.args...); (err != nil) != tt.wantErr { if err := HTTPGet(tt.args.apiEndpoint, tt.args.f, tt.args.args...); (err != nil) != tt.wantErr {
t.Errorf("HttpGet() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("HTTPGet() error = %v, wantErr %v", err, tt.wantErr)
} }
}) })
} }
......
...@@ -17,7 +17,7 @@ func init() { ...@@ -17,7 +17,7 @@ func init() {
builder = &strings.Builder{} builder = &strings.Builder{}
} }
func HttpGet(apiEndpoint, f string, args ...string) error { func HTTPGet(apiEndpoint, f string, args ...string) error {
for _, p := range args { for _, p := range args {
builder.WriteString("&") builder.WriteString("&")
builder.WriteString(p) builder.WriteString(p)
......
...@@ -42,7 +42,7 @@ var addDeviceCmd = &cobra.Command{ ...@@ -42,7 +42,7 @@ var addDeviceCmd = &cobra.Command{
Short: "adds a device to the controller", Short: "adds a device to the controller",
Long: ``, Long: ``,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return cli.HttpGet( return cli.HTTPGet(
apiEndpoint, apiEndpoint,
"addDevice", "addDevice",
"address="+address, "address="+address,
......
...@@ -45,7 +45,7 @@ var cliCmd = &cobra.Command{ ...@@ -45,7 +45,7 @@ var cliCmd = &cobra.Command{
Short: "", Short: "",
Long: ``, Long: ``,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return cli.HttpGet(apiEndpoint, "init") return cli.HTTPGet(apiEndpoint, "init")
}, },
} }
......
...@@ -42,7 +42,7 @@ var cliSetCmd = &cobra.Command{ ...@@ -42,7 +42,7 @@ var cliSetCmd = &cobra.Command{
Short: "set a value on a device", Short: "set a value on a device",
Long: ``, Long: ``,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return cli.HttpGet( return cli.HTTPGet(
apiEndpoint, apiEndpoint,
"set", "set",
"uuid="+uuid, "uuid="+uuid,
......
...@@ -42,7 +42,7 @@ var getDeviceCmd = &cobra.Command{ ...@@ -42,7 +42,7 @@ var getDeviceCmd = &cobra.Command{
Short: "gets device information from the controller", Short: "gets device information from the controller",
Long: ``, Long: ``,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return cli.HttpGet( return cli.HTTPGet(
apiEndpoint, apiEndpoint,
"getDevice", "getDevice",
"uuid="+uuid, "uuid="+uuid,
......
...@@ -42,7 +42,7 @@ var getIdsCmd = &cobra.Command{ ...@@ -42,7 +42,7 @@ var getIdsCmd = &cobra.Command{
Short: "gets device IDs from the controller", Short: "gets device IDs from the controller",
Long: ``, Long: ``,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return cli.HttpGet(apiEndpoint, "getIDs") return cli.HTTPGet(apiEndpoint, "getIDs")
}, },
} }
......
...@@ -42,7 +42,7 @@ var initCmd = &cobra.Command{ ...@@ -42,7 +42,7 @@ var initCmd = &cobra.Command{
Short: "initialise SBI and PND", Short: "initialise SBI and PND",
Long: ``, Long: ``,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return cli.HttpGet(apiEndpoint, "init") return cli.HTTPGet(apiEndpoint, "init")
}, },
} }
......
...@@ -42,7 +42,7 @@ var requestCmd = &cobra.Command{ ...@@ -42,7 +42,7 @@ var requestCmd = &cobra.Command{
Short: "requests a path from a specified device on the controller", Short: "requests a path from a specified device on the controller",
Long: ``, Long: ``,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return cli.HttpGet( return cli.HTTPGet(
apiEndpoint, apiEndpoint,
"request", "request",
"uuid="+uuid, "uuid="+uuid,
......
...@@ -42,7 +42,7 @@ var requestAllCmd = &cobra.Command{ ...@@ -42,7 +42,7 @@ var requestAllCmd = &cobra.Command{
Short: "requests specified path from all devices on the controller", Short: "requests specified path from all devices on the controller",
Long: ``, Long: ``,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
return cli.HttpGet( return cli.HTTPGet(
apiEndpoint, apiEndpoint,
"requestAll", "requestAll",
"sbi="+cliSbi, "sbi="+cliSbi,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment