summaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/api/functiondocs.md36
1 files changed, 20 insertions, 16 deletions
diff --git a/docs/src/api/functiondocs.md b/docs/src/api/functiondocs.md
index 480c10a..db5f470 100644
--- a/docs/src/api/functiondocs.md
+++ b/docs/src/api/functiondocs.md
@@ -295,8 +295,10 @@ DiscoOrganizations gets the organizations from discovery, returned as
types/discovery/discovery.go Organizations marshalled as JSON
`c` is the Cookie that needs to be passed. Create a new Cookie using
-`CookieNew` `search` is the search string for filtering the list. It checks
-for keywords and display name case insensitive as a substring matching.
+`CookieNew` `search` is the search string for filtering the list. If any of
+the words in the search query is not contained in any of the display names
+or keywords, the candidate is filtered. Otherwise they are ranked based on
+the levenshtein distance: https://en.wikipedia.org/wiki/Levenshtein_distance
If search is empty it returns ALL organizations currently known in common
If it was unsuccessful, it returns an error. Note that when the lib was
@@ -354,10 +356,10 @@ DiscoServers gets the servers from discovery, returned as
types/discovery/discovery.go Servers marshalled as JSON
`c` is the Cookie that needs to be passed. Create a new Cookie using
-`CookieNew` `search` is the search string for filtering the list. It checks
-for keywords and display name case insensitive as a substring matching.
-If search is empty it returns ALL servers currently known in common,
-including secure internet servers that do not have a display name set
+`CookieNew` `search` is the search string for filtering the list. If any of
+the words in the search query is not contained in any of the display names
+or keywords, the candidate is filtered. Otherwise they are ranked based on
+the levenshtein distance: https://en.wikipedia.org/wiki/Levenshtein_distance
If it was unsuccessful, it returns an error. Note that when the lib was
built in release mode the data is almost always non-nil, even when an error
@@ -367,16 +369,18 @@ Example Input: ```DiscoServers(myCookie, "")```
Example Output:
- {
- "server_list": [
- {
- "base_url": "https://eduvpn.rash.al/",
- "server_type": "secure_internet",
- },
- {
- "base_url": "https://eduvpn.deic.dk/",
- "server_type": "secure_internet",
- } , null
+ {
+ "server_list": [
+ {
+ "base_url": "https://eduvpn.rash.al/",
+ "country_code": "AL",
+ "server_type": "secure_internet",
+ },
+ {
+ "base_url": "https://eduvpn.deic.dk/",
+ "country_code": "DK",
+ "server_type": "secure_internet",
+ } , null
Example Input: ```DiscoServers(myCookie, "heanet")```