diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/src/api/functiondocs.md | 52 |
1 files changed, 46 insertions, 6 deletions
diff --git a/docs/src/api/functiondocs.md b/docs/src/api/functiondocs.md index 58134f7..5d7d9ac 100644 --- a/docs/src/api/functiondocs.md +++ b/docs/src/api/functiondocs.md @@ -289,19 +289,21 @@ Example Output: ## DiscoOrganizations Signature: ```go -func DiscoOrganizations(c C.uintptr_t) (*C.char, *C.char) +func DiscoOrganizations(c C.uintptr_t, search *C.char) (*C.char, *C.char) ``` 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` +`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 organizations currently known in common 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 has occurred This means it has just returned the cached list -Example Input: ```DiscoOrganizations(myCookie)``` +Example Input: ```DiscoOrganizations(myCookie, "")``` Example Output: @@ -332,22 +334,41 @@ Example Output: "secure_inte ..................... }, null +Example Input: ```DiscoOrganizations(myCookie, "rash")``` + +Example Output: + + { + "v": 1695291170, + "organization_list": [ + { + "display_name": { + "en": "Academic Network of Albania - RASH" + }, + "org_id": "https://idp.rash.al/simplesaml/saml2/idp/metadata.php", + "secure_internet_home": "https://eduvpn.rash.al/" + }, + }, null + ## DiscoServers Signature: ```go -func DiscoServers(c C.uintptr_t) (*C.char, *C.char) +func DiscoServers(c C.uintptr_t, search *C.char) (*C.char, *C.char) ``` 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` +`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 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 has occurred This means it has just returned the cached list -Example Input: ```DiscoServers(myCookie)``` +Example Input: ```DiscoServers(myCookie, "")``` Example Output: @@ -373,6 +394,25 @@ Example Output: ], .................. } , null +Example Input: ```DiscoServers(myCookie, "heanet")``` + +Example Output: + + { + "v": 1695291170, + "server_list": [ + { + "base_url": "https://eduvpn.heanet.ie/", + "display_name": "HEAnet Staff", + "server_type": "institute_access", + "support_contact": [ + "mailto:noc@heanet.ie", + "tel:+35316609040" + ] + }, + ] + } , null + ## ExpiryTimes Signature: ```go |
