v0.5-rc2: added reload cooldown, fixed auto reload, updated API

This commit is contained in:
yusing
2024-09-17 00:10:25 +08:00
parent 996b418ea9
commit c0ebd9f8c0
7 changed files with 76 additions and 45 deletions

View File

@@ -19,10 +19,9 @@ import (
type (
HTTPRoute struct {
Alias PT.Alias `json:"alias"`
TargetURL URL
PathPatterns PT.PathPatterns
Alias PT.Alias `json:"alias"`
TargetURL *URL `json:"target_url"`
PathPatterns PT.PathPatterns `json:"path_patterns"`
mux *http.ServeMux
handler *P.ReverseProxy
@@ -53,7 +52,7 @@ func NewHTTPRoute(entry *P.Entry) (*HTTPRoute, E.NestedError) {
if !ok {
r = &HTTPRoute{
Alias: entry.Alias,
TargetURL: URL(*entry.URL),
TargetURL: (*URL)(entry.URL),
PathPatterns: entry.PathPatterns,
handler: rp,
}