Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager A route/router manager.
func NewManager ¶
func NewManager(conf *runtime.Configuration, serviceManager serviceManager, middlewaresBuilder middlewareChainBuilder, observabilityMgr *middleware.ObservabilityMgr, tlsManager *tls.Manager, parser httpmuxer.SyntaxParser, ) *Manager
NewManager creates a new Manager.
func (*Manager) BuildHandlers ¶
func (m *Manager) BuildHandlers(rootCtx context.Context, entryPoints []string, tls bool) map[string]http.Handler
BuildHandlers Builds handler for all entry points.
func (*Manager) ParseRouterTree ¶
func (m *Manager) ParseRouterTree()
ParseRouterTree sets up router tree and validates router configuration. This function performs the following operations in order:
1. Populate ChildRefs: Uses ParentRefs to build the parent-child relationship graph 2. Root-first traversal: Starting from root routers (no ParentRefs), traverses the tree 3. Cycle detection: Detects circular dependencies and removes cyclic links 4. Reachability check: Marks routers unreachable from any root as disabled 5. Dead-end detection: Marks routers with no service and no children as disabled 6. Validation: Checks for configuration errors
Router status is set during this process: - Enabled: Reachable routers with valid configuration - Disabled: Unreachable, dead-end, or routers with critical errors - Warning: Routers with non-critical errors (like cycles)
The function modifies router.Status, router.ChildRefs, and adds errors to router.Err.