mirror of
https://github.com/openziti/zrok.git
synced 2024-12-22 23:02:52 +01:00
http command scaffolding
This commit is contained in:
parent
50d37132a1
commit
084cdf96df
@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"github.com/michaelquigley/pfxlog"
|
||||
"github.com/openziti-test-kitchen/zrok/http"
|
||||
"github.com/openziti-test-kitchen/zrok/proxy"
|
||||
"github.com/sirupsen/logrus"
|
||||
"github.com/spf13/cobra"
|
||||
@ -13,6 +14,7 @@ import (
|
||||
func init() {
|
||||
pfxlog.GlobalInit(logrus.InfoLevel, pfxlog.DefaultOptions().SetTrimPrefix("github.com/openziti-test-kitchen/"))
|
||||
rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "enable verbose logging")
|
||||
rootCmd.AddCommand(httpCmd)
|
||||
rootCmd.AddCommand(proxyCmd)
|
||||
}
|
||||
|
||||
@ -37,6 +39,16 @@ var proxyCmd = &cobra.Command{
|
||||
},
|
||||
}
|
||||
|
||||
var httpCmd = &cobra.Command{
|
||||
Use: "http <endpointAddress>",
|
||||
Short: "Start an http endpoint",
|
||||
Run: func(_ *cobra.Command, args []string) {
|
||||
if err := http.Run(&http.Config{EndpointAddress: args[0]}); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func main() {
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
panic(err)
|
||||
|
5
http/config.go
Normal file
5
http/config.go
Normal file
@ -0,0 +1,5 @@
|
||||
package http
|
||||
|
||||
type Config struct {
|
||||
EndpointAddress string
|
||||
}
|
5
http/http.go
Normal file
5
http/http.go
Normal file
@ -0,0 +1,5 @@
|
||||
package http
|
||||
|
||||
func Run(cfg *Config) error {
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user