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