From 313647b5aa0ad84244ee17b290f785061f36ecb8 Mon Sep 17 00:00:00 2001 From: Michael Quigley Date: Thu, 1 Dec 2022 13:11:38 -0500 Subject: [PATCH] http frontend -> access public (#121) --- cmd/zrok/{http_frontend.go => access_public.go} | 14 +++++++------- cmd/zrok/main.go | 6 ------ 2 files changed, 7 insertions(+), 13 deletions(-) rename cmd/zrok/{http_frontend.go => access_public.go} (73%) diff --git a/cmd/zrok/http_frontend.go b/cmd/zrok/access_public.go similarity index 73% rename from cmd/zrok/http_frontend.go rename to cmd/zrok/access_public.go index 23dccd1e..a987b64c 100644 --- a/cmd/zrok/http_frontend.go +++ b/cmd/zrok/access_public.go @@ -9,26 +9,26 @@ import ( ) func init() { - httpCmd.AddCommand(newHttpFrontendCommand().cmd) + accessCmd.AddCommand(newAccessPublicCommand().cmd) } -type httpFrontendCommand struct { +type accessPublicCommand struct { cmd *cobra.Command } -func newHttpFrontendCommand() *httpFrontendCommand { +func newAccessPublicCommand() *accessPublicCommand { cmd := &cobra.Command{ - Use: "frontend []", + Use: "public []", Aliases: []string{"fe"}, - Short: "Create an HTTP frontend", + Short: "Create a public access HTTP frontend", Args: cobra.RangeArgs(0, 1), } - command := &httpFrontendCommand{cmd: cmd} + command := &accessPublicCommand{cmd: cmd} cmd.Run = command.run return command } -func (self *httpFrontendCommand) run(_ *cobra.Command, args []string) { +func (self *accessPublicCommand) run(_ *cobra.Command, args []string) { cfg := public_frontend.DefaultConfig() if len(args) == 1 { if err := cfg.Load(args[0]); err != nil { diff --git a/cmd/zrok/main.go b/cmd/zrok/main.go index 5e333c80..72396c27 100644 --- a/cmd/zrok/main.go +++ b/cmd/zrok/main.go @@ -16,7 +16,6 @@ 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(httpCmd) rootCmd.AddCommand(shareCmd) } @@ -38,11 +37,6 @@ var accessCmd = &cobra.Command{ Short: "Access services", } -var httpCmd = &cobra.Command{ - Use: "http", - Short: "HTTP endpoint operations", -} - var shareCmd = &cobra.Command{ Use: "share", Short: "Share resources",