|
|
@ -42,6 +42,8 @@ type RouterConfig struct {
|
|
|
|
RuleList []json.RawMessage `json:"rules"`
|
|
|
|
RuleList []json.RawMessage `json:"rules"`
|
|
|
|
DomainStrategy *string `json:"domainStrategy"`
|
|
|
|
DomainStrategy *string `json:"domainStrategy"`
|
|
|
|
Balancers []*BalancingRule `json:"balancers"`
|
|
|
|
Balancers []*BalancingRule `json:"balancers"`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DomainMatcher string `json:"domainMatcher"`
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func (c *RouterConfig) getDomainStrategy() router.Config_DomainStrategy {
|
|
|
|
func (c *RouterConfig) getDomainStrategy() router.Config_DomainStrategy {
|
|
|
@ -82,6 +84,11 @@ func (c *RouterConfig) Build() (*router.Config, error) {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if rule.DomainMatcher == "" {
|
|
|
|
|
|
|
|
rule.DomainMatcher = c.DomainMatcher
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
config.Rule = append(config.Rule, rule)
|
|
|
|
config.Rule = append(config.Rule, rule)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for _, rawBalancer := range c.Balancers {
|
|
|
|
for _, rawBalancer := range c.Balancers {
|
|
|
|