refactor(state): replace Entrypoint method with ShortLinkMatcher interface

- Cleaned up agent go.mod by removing unused indirect dependencies.
This commit is contained in:
yusing
2026-01-04 12:43:05 +08:00
parent c00854a124
commit 11d0c61b9c
5 changed files with 15 additions and 14 deletions

View File

@@ -126,12 +126,12 @@ func (s *FileServer) Start(parent task.Parent) gperr.Error {
routes.HTTP.Add(s)
if state := config.WorkingState.Load(); state != nil {
state.Entrypoint().ShortLinkMatcher().AddRoute(s.Alias)
state.ShortLinkMatcher().AddRoute(s.Alias)
}
s.task.OnFinished("remove_route_from_http", func() {
routes.HTTP.Del(s)
if state := config.WorkingState.Load(); state != nil {
state.Entrypoint().ShortLinkMatcher().DelRoute(s.Alias)
state.ShortLinkMatcher().DelRoute(s.Alias)
}
})
return nil