-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor web server and clash sub handling
This commit refactors the web server implementation and improves the handling of clash subscriptions. It introduces a new `Server` struct in the `web` package, which encapsulates the Echo web framework and provides a cleaner interface for registering routes and middleware. The `NewServer` function now takes an additional `relayReloader` parameter, which allows the server to reload relay configurations when necessary. The `Config` struct in the `config` package has been enhanced to include a `cachedClashSubMap` field, which stores Clash subscription objects for efficient retrieval. The `GetClashSubList` method has been added to retrieve a list of Clash subscriptions from the configuration. Additionally, the `getOrCreateClashSub` method has been introduced to handle the creation and caching of Clash subscription objects. These changes improve the overall organization and maintainability of the codebase.
- Loading branch information
Showing
11 changed files
with
223 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package reloader | ||
|
||
import "context" | ||
|
||
type Reloader interface { | ||
Reload() error | ||
WatchAndReload(ctx context.Context) | ||
TriggerReload() | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.