mirror of
https://github.com/openziti/zrok.git
synced 2025-01-09 15:38:21 +01:00
http frontend -> access public (#121)
This commit is contained in:
parent
44f4e37e83
commit
313647b5aa
@ -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 [<configPath>]",
|
||||
Use: "public [<configPath>]",
|
||||
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 {
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user