remove cmd for now

This commit is contained in:
dovholuknf
2020-07-06 15:24:22 -04:00
parent dcefc9088a
commit 795f3a1293
13 changed files with 0 additions and 486 deletions
-44
View File
@@ -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)
}
}
@@ -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")
},
}
-37
View File
@@ -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")
},
}
@@ -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")
},
}
-37
View File
@@ -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")
},
}
@@ -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")
},
}
-37
View File
@@ -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")
},
}
@@ -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")
},
}
@@ -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")
},
}
-36
View File
@@ -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")
},
}
@@ -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")
},
}
-36
View File
@@ -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")
},
}
-37
View File
@@ -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")
},
}