summaryrefslogtreecommitdiff
path: root/conf/delete.go
diff options
context:
space:
mode:
Diffstat (limited to 'conf/delete.go')
-rw-r--r--conf/delete.go54
1 files changed, 0 insertions, 54 deletions
diff --git a/conf/delete.go b/conf/delete.go
deleted file mode 100644
index 384e392..0000000
--- a/conf/delete.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package main
-
-import (
- "fmt"
- "log"
-)
-
-
-var rmUser = &Command{
- Name: "user",
- Execute: func(args []string) {
- if len(args) < 1 {
- fmt.Println("error: username not provided")
- return
- }
- username := args[0]
- user, err := p.GetByUsername(username)
- if err != nil { log.Fatal(err) }
- err = p.DeleteUser(user)
- if err != nil { log.Fatal(err) }
- fmt.Printf("deleted user %v\n", username)
- },
-}
-
-
-var rmEndpoint = &Command{
- Name: "endpoint",
- Execute: func(args []string) {
- if len(args) < 1 {
- fmt.Println("error: endpointname not provided")
- return
- }
- name := args[0]
- endpoint, err := p.GetEndpointByName(name)
- if err != nil { log.Fatal(err) }
- err = p.DeleteEndpoint(endpoint)
- if err != nil { log.Fatal(err) }
- fmt.Printf("deleted endpoint %v\n", name)
- },
-}
-
-
-
-
-func RmInit(parser *Command) {
- rm := &Command{
- Name: "rm",
- Branch: true,
- }
-
- rm.AddCommand(rmUser)
- rm.AddCommand(rmEndpoint)
- parser.AddCommand(rm)
-}