mirror of
https://github.com/mentos1386/zdravko.git
synced 2024-11-25 17:05:21 +00:00
28 lines
800 B
Go
28 lines
800 B
Go
package temporal
|
|
|
|
import (
|
|
internal "github.com/mentos1386/zdravko/internal/config"
|
|
"github.com/temporalio/ui-server/v2/server"
|
|
"github.com/temporalio/ui-server/v2/server/config"
|
|
"github.com/temporalio/ui-server/v2/server/server_options"
|
|
)
|
|
|
|
func NewUiConfig(cfg *internal.TemporalConfig) *config.Config {
|
|
return &config.Config{
|
|
BannerText: "Hello world!",
|
|
Host: cfg.ListenAddress,
|
|
Port: 8223,
|
|
TemporalGRPCAddress: "0.0.0.0:7233",
|
|
EnableUI: true,
|
|
PublicPath: "/settings/temporal",
|
|
ForwardHeaders: []string{"Authorization"},
|
|
Codec: config.Codec{
|
|
Endpoint: "",
|
|
},
|
|
}
|
|
}
|
|
|
|
func NewUiServer(cfg *config.Config) (*server.Server, error) {
|
|
s := server.NewServer(server_options.WithConfigProvider(cfg))
|
|
return s, nil
|
|
}
|