2020-03-25 07:58:58 +01:00
|
|
|
package grpc
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
ServerPort string
|
|
|
|
GatewayPort string
|
|
|
|
CustomHeaders []string
|
|
|
|
}
|
|
|
|
|
2020-03-27 13:57:16 +01:00
|
|
|
func (c Config) ToServerConfig() ServerConfig {
|
|
|
|
return ServerConfig{
|
2020-03-25 10:41:17 +01:00
|
|
|
Port: c.ServerPort,
|
2020-03-25 07:58:58 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-27 13:57:16 +01:00
|
|
|
func (c Config) ToGatewayConfig() GatewayConfig {
|
|
|
|
return GatewayConfig{
|
2020-03-25 07:58:58 +01:00
|
|
|
Port: c.GatewayPort,
|
|
|
|
GRPCEndpoint: c.ServerPort,
|
|
|
|
CustomHeaders: c.CustomHeaders,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
type ServerConfig struct {
|
2020-03-25 10:41:17 +01:00
|
|
|
Port string
|
2020-03-25 07:58:58 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
type GatewayConfig struct {
|
|
|
|
Port string
|
|
|
|
GRPCEndpoint string
|
|
|
|
CustomHeaders []string
|
|
|
|
}
|