Major Refactoring, Client can now be used as a library
Some checks failed
Build (artifact) / build (push) Failing after 1m3s
Some checks failed
Build (artifact) / build (push) Failing after 1m3s
This commit is contained in:
41
cmd/bundle/main.go
Normal file
41
cmd/bundle/main.go
Normal file
@@ -0,0 +1,41 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.nevets.tech/Keys/certman/app/executor"
|
||||
"git.nevets.tech/Keys/certman/app/shared"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
//TODO create logic for gh vs gt repos
|
||||
|
||||
func main() {
|
||||
rootCmd := &cobra.Command{
|
||||
Use: "certman",
|
||||
Short: "CertMan",
|
||||
Long: "Certificate Manager",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return cmd.Help()
|
||||
},
|
||||
}
|
||||
|
||||
rootCmd.AddCommand(shared.VersionCmd)
|
||||
rootCmd.AddCommand(shared.NewKeyCmd)
|
||||
rootCmd.AddCommand(shared.DevCmd)
|
||||
|
||||
rootCmd.AddCommand(shared.NewDomainCmd)
|
||||
rootCmd.AddCommand(shared.InstallCmd)
|
||||
|
||||
rootCmd.AddCommand(shared.CertCmd)
|
||||
|
||||
rootCmd.AddCommand(executor.ExecutorCmd)
|
||||
|
||||
rootCmd.AddCommand(shared.DaemonCmd)
|
||||
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
18
cmd/client/commands.go
Normal file
18
cmd/client/commands.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"git.nevets.tech/Keys/certman/app/client"
|
||||
"git.nevets.tech/Keys/certman/app/shared"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func init() {
|
||||
shared.DaemonCmd.AddCommand(&cobra.Command{
|
||||
Use: "start",
|
||||
Short: "Start the daemon",
|
||||
Args: cobra.NoArgs,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return shared.RunDaemonCmd(&client.Daemon{})
|
||||
},
|
||||
})
|
||||
}
|
||||
36
cmd/client/main.go
Normal file
36
cmd/client/main.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.nevets.tech/Keys/certman/app/shared"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func main() {
|
||||
rootCmd := &cobra.Command{
|
||||
Use: "certman",
|
||||
Short: "CertMan",
|
||||
Long: "Certificate Manager",
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return cmd.Help()
|
||||
},
|
||||
}
|
||||
|
||||
rootCmd.AddCommand(shared.VersionCmd)
|
||||
rootCmd.AddCommand(shared.NewKeyCmd)
|
||||
rootCmd.AddCommand(shared.DevCmd)
|
||||
|
||||
rootCmd.AddCommand(shared.NewDomainCmd)
|
||||
rootCmd.AddCommand(shared.InstallCmd)
|
||||
|
||||
rootCmd.AddCommand(shared.CertCmd)
|
||||
|
||||
rootCmd.AddCommand(shared.DaemonCmd)
|
||||
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
7
cmd/executor/main.go
Normal file
7
cmd/executor/main.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello Executor")
|
||||
}
|
||||
18
cmd/server/commands.go
Normal file
18
cmd/server/commands.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"git.nevets.tech/Keys/certman/app/server"
|
||||
"git.nevets.tech/Keys/certman/app/shared"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func init() {
|
||||
shared.DaemonCmd.AddCommand(&cobra.Command{
|
||||
Use: "start",
|
||||
Short: "Start the daemon",
|
||||
Args: cobra.NoArgs,
|
||||
RunE: func(cmd *cobra.Command, args []string) error {
|
||||
return shared.RunDaemonCmd(&server.Daemon{})
|
||||
},
|
||||
})
|
||||
}
|
||||
7
cmd/server/main.go
Normal file
7
cmd/server/main.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
fmt.Println("Hello server")
|
||||
}
|
||||
Reference in New Issue
Block a user