allow multiple docker providers, added file provider support

This commit is contained in:
yusing
2024-03-11 10:31:01 +00:00
parent e736fe1f1e
commit d3684b62b7
25 changed files with 627 additions and 246 deletions

View File

@@ -6,7 +6,7 @@ import (
)
type pathPoolMap struct {
*SafeMap[string, *httpLoadBalancePool]
SafeMap[string, *httpLoadBalancePool]
}
func newPathPoolMap() pathPoolMap {
@@ -21,7 +21,8 @@ func (m pathPoolMap) Add(path string, route *HTTPRoute) {
}
func (m pathPoolMap) FindMatch(pathGot string) (*HTTPRoute, error) {
for pathWant, v := range m.m {
pool := m.Iterator()
for pathWant, v := range pool {
if strings.HasPrefix(pathGot, pathWant) {
return v.Pick(), nil
}