mirror of
https://github.com/caddyserver/caddy.git
synced 2026-09-13 08:22:04 +00:00
parent
20d487be57
commit
754fe4f7b4
4 changed files with 49 additions and 20 deletions
|
|
@ -109,6 +109,17 @@ func (r Route) Empty() bool {
|
|||
r.Group == ""
|
||||
}
|
||||
|
||||
func (r Route) String() string {
|
||||
handlersRaw := "["
|
||||
for _, hr := range r.HandlersRaw {
|
||||
handlersRaw += " " + string(hr)
|
||||
}
|
||||
handlersRaw += "]"
|
||||
|
||||
return fmt.Sprintf(`{Group:"%s" MatcherSetsRaw:%s HandlersRaw:%s Terminal:%t}`,
|
||||
r.Group, r.MatcherSetsRaw, handlersRaw, r.Terminal)
|
||||
}
|
||||
|
||||
// RouteList is a list of server routes that can
|
||||
// create a middleware chain.
|
||||
type RouteList []Route
|
||||
|
|
@ -331,4 +342,15 @@ func (ms *MatcherSets) FromInterface(matcherSets any) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// TODO: Is this used?
|
||||
func (ms MatcherSets) String() string {
|
||||
result := "["
|
||||
for _, matcherSet := range ms {
|
||||
for _, matcher := range matcherSet {
|
||||
result += fmt.Sprintf(" %#v", matcher)
|
||||
}
|
||||
}
|
||||
return result + " ]"
|
||||
}
|
||||
|
||||
var routeGroupCtxKey = caddy.CtxKey("route_group")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue