add priority option in case some tool has inconsistent issue

This commit is contained in:
2025-02-06 11:05:18 +08:00
parent f3d5eb9fbd
commit 557a60f5de
3 changed files with 127 additions and 74 deletions

View File

@ -5,15 +5,21 @@ import (
"time"
)
type UpstreamPriorityGroup struct {
Match string `yaml:"match"`
Priority int `yaml:"priority"`
}
type UpstreamMatch struct {
Match string `yaml:"match"`
Replace string `yaml:"replace"`
}
type Upstream struct {
Server string `yaml:"server"`
Match UpstreamMatch `yaml:"match"`
AllowedRedirect *string `yaml:"allowed-redirect"`
Server string `yaml:"server"`
Match UpstreamMatch `yaml:"match"`
AllowedRedirect *string `yaml:"allowed-redirect"`
PriorityGroups []UpstreamPriorityGroup `yaml:"priority-groups"`
}
func (upstream Upstream) GetPath(orig string) (string, bool, error) {