mirror of
https://github.com/openziti/zrok.git
synced 2025-06-20 01:37:52 +02:00
parent
313647b5aa
commit
4897fb399e
@ -8,25 +8,25 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(newGcCmd().cmd)
|
||||
adminCmd.AddCommand(newAdminGcCommand().cmd)
|
||||
}
|
||||
|
||||
type gcCmd struct {
|
||||
type adminGcCommand struct {
|
||||
cmd *cobra.Command
|
||||
}
|
||||
|
||||
func newGcCmd() *gcCmd {
|
||||
func newAdminGcCommand() *adminGcCommand {
|
||||
cmd := &cobra.Command{
|
||||
Use: "gc <configPath>",
|
||||
Short: "Garbage collect a zrok instance",
|
||||
Args: cobra.ExactArgs(1),
|
||||
}
|
||||
c := &gcCmd{cmd: cmd}
|
||||
c := &adminGcCommand{cmd: cmd}
|
||||
cmd.Run = c.run
|
||||
return c
|
||||
}
|
||||
|
||||
func (gc *gcCmd) run(_ *cobra.Command, args []string) {
|
||||
func (gc *adminGcCommand) run(_ *cobra.Command, args []string) {
|
||||
cfg, err := controller.LoadConfig(args[0])
|
||||
if err != nil {
|
||||
panic(err)
|
@ -16,7 +16,9 @@ func init() {
|
||||
rootCmd.PersistentFlags().BoolVarP(&panicInstead, "panic", "p", false, "Panic instead of showing pretty errors")
|
||||
zrokdir.AddZrokApiEndpointFlag(&apiEndpoint, rootCmd.PersistentFlags())
|
||||
rootCmd.AddCommand(accessCmd)
|
||||
rootCmd.AddCommand(adminCmd)
|
||||
rootCmd.AddCommand(shareCmd)
|
||||
rootCmd.AddCommand(testCmd)
|
||||
}
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
@ -34,12 +36,22 @@ var apiEndpoint string
|
||||
|
||||
var accessCmd = &cobra.Command{
|
||||
Use: "access",
|
||||
Short: "Access services",
|
||||
Short: "Create frontend access for services",
|
||||
}
|
||||
|
||||
var adminCmd = &cobra.Command{
|
||||
Use: "admin",
|
||||
Short: "Administration and operations functions",
|
||||
}
|
||||
|
||||
var shareCmd = &cobra.Command{
|
||||
Use: "share",
|
||||
Short: "Share resources",
|
||||
Short: "Create backend access for services",
|
||||
}
|
||||
|
||||
var testCmd = &cobra.Command{
|
||||
Use: "test",
|
||||
Short: "Utilities for testing zrok deployments",
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
@ -26,7 +26,7 @@ type reserveCommand struct {
|
||||
func newReserveCommand() *reserveCommand {
|
||||
cmd := &cobra.Command{
|
||||
Use: "reserve <public|private> <targetEndpoint>",
|
||||
Short: "Reserve a service",
|
||||
Short: "Create a reserved service",
|
||||
Args: cobra.ExactArgs(2),
|
||||
}
|
||||
command := &reserveCommand{cmd: cmd}
|
||||
|
@ -14,12 +14,6 @@ import (
|
||||
|
||||
func init() {
|
||||
testCmd.AddCommand(newTestEndpointCommand().cmd)
|
||||
rootCmd.AddCommand(testCmd)
|
||||
}
|
||||
|
||||
var testCmd = &cobra.Command{
|
||||
Use: "test",
|
||||
Short: "Utilities used for testing zrok",
|
||||
}
|
||||
|
||||
type testEndpointCommand struct {
|
||||
|
Loading…
x
Reference in New Issue
Block a user