mirror of
https://github.com/openziti/zrok.git
synced 2025-06-26 12:42:18 +02:00
http -> http bind, part 2 (#32)
This commit is contained in:
parent
73283660f8
commit
bb55008451
@ -24,7 +24,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
rootCmd.AddCommand(newHttpBindCommand().cmd)
|
httpCmd.AddCommand(newHttpBindCommand().cmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
type httpBindCommand struct {
|
type httpBindCommand struct {
|
||||||
@ -35,8 +35,8 @@ type httpBindCommand struct {
|
|||||||
|
|
||||||
func newHttpBindCommand() *httpBindCommand {
|
func newHttpBindCommand() *httpBindCommand {
|
||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "http <endpoint>",
|
Use: "bind <endpoint>",
|
||||||
Short: "Start an HTTP terminator",
|
Short: "Create an HTTP binding",
|
||||||
Args: cobra.ExactArgs(1),
|
Args: cobra.ExactArgs(1),
|
||||||
}
|
}
|
||||||
command := &httpBindCommand{cmd: cmd}
|
command := &httpBindCommand{cmd: cmd}
|
||||||
|
@ -13,6 +13,7 @@ func init() {
|
|||||||
pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti-test-kitchen/"))
|
pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti-test-kitchen/"))
|
||||||
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "enable verbose logging")
|
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "enable verbose logging")
|
||||||
rootCmd.PersistentFlags().StringVarP(&endpoint, "endpoint", "e", "localhost:10888", "zrok endpoint address")
|
rootCmd.PersistentFlags().StringVarP(&endpoint, "endpoint", "e", "localhost:10888", "zrok endpoint address")
|
||||||
|
rootCmd.AddCommand(httpCmd)
|
||||||
}
|
}
|
||||||
|
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
@ -27,6 +28,11 @@ var rootCmd = &cobra.Command{
|
|||||||
var verbose bool
|
var verbose bool
|
||||||
var endpoint string
|
var endpoint string
|
||||||
|
|
||||||
|
var httpCmd = &cobra.Command{
|
||||||
|
Use: "http",
|
||||||
|
Short: "HTTP endpoint operations",
|
||||||
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if err := rootCmd.Execute(); err != nil {
|
if err := rootCmd.Execute(); err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user