diff options
| author | Bobby <[email protected]> | 2026-03-08 23:38:54 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2026-03-08 23:38:54 +0530 |
| commit | 94d5561e7cc39eb2909bdc36d4ef4972cd21e56d (patch) | |
| tree | 98d9792dda80f76f185ab2eb37c1de005be9ea0f /utils/urls | |
| parent | 1136af49815be77a0aca151f3b8ec7348bf4b4c8 (diff) | |
| download | dove-94d5561e7cc39eb2909bdc36d4ef4972cd21e56d.tar.xz dove-94d5561e7cc39eb2909bdc36d4ef4972cd21e56d.zip | |
Refactor DNS and SMTP configurations; add system DNS management
- Updated DNS server address configuration to use BindAddress and DnsPort.
- Enhanced email submission to utilize BindAddress for SMTP server address.
- Improved error messages for unknown recipient domains.
- Introduced a new OrderedMap structure for route management.
- Added system DNS management functions for Linux, Darwin, and Windows platforms.
- Created new dashboard services for DNS configuration and overview.
- Updated UI to include Proxy Rules section and improved descriptions.
- Added new utility functions for handling DNS configurations.
Diffstat (limited to 'utils/urls')
| -rw-r--r-- | utils/urls/attach.go | 2 | ||||
| -rw-r--r-- | utils/urls/path.go | 6 | ||||
| -rw-r--r-- | utils/urls/registry.go | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/utils/urls/attach.go b/utils/urls/attach.go index baf9929..906d765 100644 --- a/utils/urls/attach.go +++ b/utils/urls/attach.go @@ -6,7 +6,7 @@ func Attach(application *fiber.App) { registry.Mutex.Lock() defer registry.Mutex.Unlock() - for _, route := range registry.Routes { + for _, route := range registry.Routes.All() { bindRoute(application, route) } } diff --git a/utils/urls/path.go b/utils/urls/path.go index a3b3ec9..28f400f 100644 --- a/utils/urls/path.go +++ b/utils/urls/path.go @@ -26,21 +26,21 @@ func Path(method HTTPMethod, path string, handler fiber.Handler, name string) { fullName := resolveFullName(namespace, name) fullPath := resolveFullPath(namespace, path) - registry.Routes[fullName] = RegisteredRoute{ + registry.Routes.Set(fullName, RegisteredRoute{ Method: method, Path: path, Handler: handler, Namespace: namespace, Name: name, FullPath: fullPath, - } + }) } func GetFullPath(routeName string) (string, bool) { registry.Mutex.Lock() defer registry.Mutex.Unlock() - route, exists := registry.Routes[routeName] + route, exists := registry.Routes.Get(routeName) if !exists { return "", false } diff --git a/utils/urls/registry.go b/utils/urls/registry.go index e95d30c..e384a1e 100644 --- a/utils/urls/registry.go +++ b/utils/urls/registry.go @@ -20,11 +20,11 @@ type RegisteredRoute struct { type RouteRegistry struct { Mutex sync.Mutex CurrentNamespace string - Routes collections.Record[string, RegisteredRoute] + Routes collections.OrderedMap[string, RegisteredRoute] } var registry = &RouteRegistry{ - Routes: make(collections.Record[string, RegisteredRoute]), + Routes: collections.OrderedMapOf[string, RegisteredRoute](), } func SetNamespace(namespace string) { |
