From 83240b5fd978753e6b515c24272a2d7fa7861db7 Mon Sep 17 00:00:00 2001 From: jwijenbergh Date: Wed, 29 May 2024 14:22:59 +0200 Subject: Exports Doc: Small updates --- docs/src/api/functiondocs.md | 36 ++++++++++++++++++++---------------- 1 file changed, 20 insertions(+), 16 deletions(-) (limited to 'docs') 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")``` -- cgit v1.2.3