summaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
authorjwijenbergh <jeroenwijenbergh@protonmail.com>2024-05-23 15:33:11 +0200
committerJeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com>2024-05-29 14:36:10 +0200
commitbe74ef76b30e7ad9fc74294c8e94ff1f40e87b4e (patch)
treeb92150ebaed0d37f4baf822adc7979c846ba5091 /types
parentef7f44e4bb7713b18e6c0ab1b6e3510075b6623b (diff)
Discovery: Improve search using levenshtein distance and sorting
Diffstat (limited to 'types')
-rw-r--r--types/discovery/discovery.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/types/discovery/discovery.go b/types/discovery/discovery.go
index 4d92766..f1f8ed6 100644
--- a/types/discovery/discovery.go
+++ b/types/discovery/discovery.go
@@ -17,6 +17,8 @@ type Organization struct {
DisplayName MapOrString `json:"display_name,omitempty"`
// OrgID is the organization ID for the server
OrgID string `json:"org_id"`
+ // score is the score internally used for sorting
+ Score int `json:"-"`
}
// Servers is the type that defines the upstream discovery format for the list of servers
@@ -36,6 +38,8 @@ type Server struct {
Type string `json:"server_type"`
// CountryCode is the country code of the server if Type is "secure_internet", e.g. nl
CountryCode string `json:"country_code"`
+ // score is the score internally used for sorting
+ Score int `json:"-"`
}
// MapOrString is a custom type as the upstream discovery format is a map or a value.