From 795f3a1293a8e2174bb259f94310ee02e079dd34 Mon Sep 17 00:00:00 2001 From: dovholuknf <46322585+dovholuknf@users.noreply.github.com> Date: Mon, 6 Jul 2020 15:24:22 -0400 Subject: [PATCH] remove cmd for now --- service/ziti-tunnel/cmd/root.go | 44 ------------------- service/ziti-tunnel/cmd/root_addidentity.go | 37 ---------------- service/ziti-tunnel/cmd/root_debug.go | 37 ---------------- service/ziti-tunnel/cmd/root_disable_id.go | 37 ---------------- service/ziti-tunnel/cmd/root_enable_id.go | 37 ---------------- .../ziti-tunnel/cmd/root_removeidentity.go | 37 ---------------- service/ziti-tunnel/cmd/root_svc.go | 37 ---------------- service/ziti-tunnel/cmd/root_svc_install.go | 37 ---------------- service/ziti-tunnel/cmd/root_svc_remove.go | 37 ---------------- service/ziti-tunnel/cmd/root_svc_start.go | 36 --------------- service/ziti-tunnel/cmd/root_svc_status.go | 37 ---------------- service/ziti-tunnel/cmd/root_svc_stop.go | 36 --------------- service/ziti-tunnel/cmd/version.go | 37 ---------------- 13 files changed, 486 deletions(-) delete mode 100644 service/ziti-tunnel/cmd/root.go delete mode 100644 service/ziti-tunnel/cmd/root_addidentity.go delete mode 100644 service/ziti-tunnel/cmd/root_debug.go delete mode 100644 service/ziti-tunnel/cmd/root_disable_id.go delete mode 100644 service/ziti-tunnel/cmd/root_enable_id.go delete mode 100644 service/ziti-tunnel/cmd/root_removeidentity.go delete mode 100644 service/ziti-tunnel/cmd/root_svc.go delete mode 100644 service/ziti-tunnel/cmd/root_svc_install.go delete mode 100644 service/ziti-tunnel/cmd/root_svc_remove.go delete mode 100644 service/ziti-tunnel/cmd/root_svc_start.go delete mode 100644 service/ziti-tunnel/cmd/root_svc_status.go delete mode 100644 service/ziti-tunnel/cmd/root_svc_stop.go delete mode 100644 service/ziti-tunnel/cmd/version.go diff --git a/service/ziti-tunnel/cmd/root.go b/service/ziti-tunnel/cmd/root.go deleted file mode 100644 index 5c50bef5..00000000 --- a/service/ziti-tunnel/cmd/root.go +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( - "fmt" - "github.com/spf13/cobra" - "os" - "path/filepath" -) -var exeName, _ = os.Executable() -var rootCmd = &cobra.Command{ - Use: filepath.Base(exeName) , - Short: "Runs the ziti-tunnel as a service", - Long: `This program provides access to a ziti-based network. - When executed without parameters it is expected that this application is running as a service`, - Run: func(cmd *cobra.Command, args []string) { - // Do Stuff Here - fmt.Println("i am in command") - }, -} - -func Execute() { - if err := rootCmd.Execute(); err != nil { - fmt.Println(err) - os.Exit(1) - } - -} diff --git a/service/ziti-tunnel/cmd/root_addidentity.go b/service/ziti-tunnel/cmd/root_addidentity.go deleted file mode 100644 index 087e1321..00000000 --- a/service/ziti-tunnel/cmd/root_addidentity.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - rootCmd.AddCommand(addIdCmd) -} - -var addIdCmd = &cobra.Command{ - Use: "addId", - Short: "Adds the provided jwt file to the running service", - Hidden: true, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Adds the provided jwt file to the running service") - }, -} diff --git a/service/ziti-tunnel/cmd/root_debug.go b/service/ziti-tunnel/cmd/root_debug.go deleted file mode 100644 index 327b0672..00000000 --- a/service/ziti-tunnel/cmd/root_debug.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - rootCmd.AddCommand(debugCmd) -} - -var debugCmd = &cobra.Command{ - Use: "debug", - Short: "Runs the program interactively instead of expecting to be run as a service. Used in debugging", - Hidden: true, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Runs the program interactively instead of expecting to be run as a service. Used in debugging") - }, -} diff --git a/service/ziti-tunnel/cmd/root_disable_id.go b/service/ziti-tunnel/cmd/root_disable_id.go deleted file mode 100644 index eae3ab7d..00000000 --- a/service/ziti-tunnel/cmd/root_disable_id.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - rootCmd.AddCommand(disableIdCmd) -} - -var disableIdCmd = &cobra.Command{ - Use: "disable", - Short: "Disables any identity in the running service using the provided fingerprint", - Hidden: true, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Disables any identity in the running service using the provided fingerprint") - }, -} diff --git a/service/ziti-tunnel/cmd/root_enable_id.go b/service/ziti-tunnel/cmd/root_enable_id.go deleted file mode 100644 index e3ffcb8b..00000000 --- a/service/ziti-tunnel/cmd/root_enable_id.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - rootCmd.AddCommand(enableIdCmd) -} - -var enableIdCmd = &cobra.Command{ - Use: "enable", - Short: "Enables any identity in the running service using the provided fingerprint", - Hidden: true, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Enables any identity in the running service using the provided fingerprint") - }, -} diff --git a/service/ziti-tunnel/cmd/root_removeidentity.go b/service/ziti-tunnel/cmd/root_removeidentity.go deleted file mode 100644 index ec8b55d2..00000000 --- a/service/ziti-tunnel/cmd/root_removeidentity.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - rootCmd.AddCommand(removeIdCmd) -} - -var removeIdCmd = &cobra.Command{ - Use: "removeId", - Short: "Removes any identity from the running service using the provided fingerprint", - Hidden: true, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Removes any identity from the running service using the provided fingerprint") - }, -} diff --git a/service/ziti-tunnel/cmd/root_svc.go b/service/ziti-tunnel/cmd/root_svc.go deleted file mode 100644 index a1768b41..00000000 --- a/service/ziti-tunnel/cmd/root_svc.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - rootCmd.AddCommand(serviceCmd) -} - -var serviceCmd = &cobra.Command{ - Use: "service", - Short: "Expects to run the program as a service", - Hidden: true, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("print or return the version here") - }, -} diff --git a/service/ziti-tunnel/cmd/root_svc_install.go b/service/ziti-tunnel/cmd/root_svc_install.go deleted file mode 100644 index bbacff4c..00000000 --- a/service/ziti-tunnel/cmd/root_svc_install.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - serviceCmd.AddCommand(installCmd) -} - -var installCmd = &cobra.Command{ - Use: "install", - Short: "Installs the executable as a service.", - Long: `When installing as a service using this function make sure not to move the executable. The path to the executing program will be used in the service`, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("install this thing as a service") - }, -} diff --git a/service/ziti-tunnel/cmd/root_svc_remove.go b/service/ziti-tunnel/cmd/root_svc_remove.go deleted file mode 100644 index 60e360ca..00000000 --- a/service/ziti-tunnel/cmd/root_svc_remove.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - serviceCmd.AddCommand(removeCmd) -} - -var removeCmd = &cobra.Command{ - Use: "remove", - Short: "Removes the executable as a service.", - Long: `When removing the service make sure the path and service name have not changed`, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("remove this thing as a service") - }, -} diff --git a/service/ziti-tunnel/cmd/root_svc_start.go b/service/ziti-tunnel/cmd/root_svc_start.go deleted file mode 100644 index ad4918c4..00000000 --- a/service/ziti-tunnel/cmd/root_svc_start.go +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - serviceCmd.AddCommand(startCmd) -} - -var startCmd = &cobra.Command{ - Use: "start", - Short: "Tries to start the service", - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Tries to start the service") - }, -} diff --git a/service/ziti-tunnel/cmd/root_svc_status.go b/service/ziti-tunnel/cmd/root_svc_status.go deleted file mode 100644 index d3c820ab..00000000 --- a/service/ziti-tunnel/cmd/root_svc_status.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - serviceCmd.AddCommand(statusCmd) -} - -var statusCmd = &cobra.Command{ - Use: "status", - Short: "Prints the status of the service", - Hidden: true, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("Prints the status of the service") - }, -} diff --git a/service/ziti-tunnel/cmd/root_svc_stop.go b/service/ziti-tunnel/cmd/root_svc_stop.go deleted file mode 100644 index 48ddb636..00000000 --- a/service/ziti-tunnel/cmd/root_svc_stop.go +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - serviceCmd.AddCommand(stopCmd) -} - -var stopCmd = &cobra.Command{ - Use: "stop", - Short: "Tries to stop the service", - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("try to stop the service") - }, -} diff --git a/service/ziti-tunnel/cmd/version.go b/service/ziti-tunnel/cmd/version.go deleted file mode 100644 index da7a6ca7..00000000 --- a/service/ziti-tunnel/cmd/version.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright NetFoundry, Inc. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -package cmd - -import ( -"fmt" - -"github.com/spf13/cobra" -) - -func init() { - rootCmd.AddCommand(versionCmd) -} - -var versionCmd = &cobra.Command{ - Use: "version", - Short: "Print the version of the current executable", - Long: ``, - Run: func(cmd *cobra.Command, args []string) { - fmt.Println("print or return the version here") - }, -}