mirror of
https://github.com/openziti/zrok.git
synced 2025-06-24 19:51:32 +02:00
elaborating controller config (#23)
This commit is contained in:
parent
4d427894ea
commit
8606072b80
@ -43,8 +43,10 @@ func (cmd *controllerCommand) run(_ *cobra.Command, _ []string) {
|
||||
panic(err)
|
||||
}
|
||||
if err := controller.Run(&controller.Config{
|
||||
Host: host,
|
||||
Port: port,
|
||||
Endpoint: controller.EndpointConfig{
|
||||
Host: host,
|
||||
Port: port,
|
||||
},
|
||||
Store: &store.Config{Path: cmd.dbPath},
|
||||
}); err != nil {
|
||||
panic(err)
|
||||
|
@ -3,7 +3,16 @@ package controller
|
||||
import "github.com/openziti-test-kitchen/zrok/controller/store"
|
||||
|
||||
type Config struct {
|
||||
Host string
|
||||
Port int
|
||||
Store *store.Config
|
||||
Endpoint EndpointConfig
|
||||
Proxy ProxyConfig
|
||||
Store *store.Config
|
||||
}
|
||||
|
||||
type EndpointConfig struct {
|
||||
Host string
|
||||
Port int
|
||||
}
|
||||
|
||||
type ProxyConfig struct {
|
||||
UrlTemplate string
|
||||
}
|
||||
|
@ -39,8 +39,8 @@ func Run(cfg *Config) error {
|
||||
|
||||
server := rest_server_zrok.NewServer(api)
|
||||
defer func() { _ = server.Shutdown() }()
|
||||
server.Host = cfg.Host
|
||||
server.Port = cfg.Port
|
||||
server.Host = cfg.Endpoint.Host
|
||||
server.Port = cfg.Endpoint.Port
|
||||
server.ConfigureAPI()
|
||||
if err := server.Serve(); err != nil {
|
||||
return errors.Wrap(err, "api server error")
|
||||
|
Loading…
x
Reference in New Issue
Block a user