diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2023-09-21 10:47:13 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2023-09-25 09:43:37 +0200 |
| commit | 59f4f01464405cd5e2e4117d5ef0d6a08f8d1739 (patch) | |
| tree | 0b0e7a30ebecbed4a678a8e986d6bae6b2228961 /exports/exports.go | |
| parent | 0f84f2f01becd897a5595606e7a3d126e581c810 (diff) | |
Exports: Update docs
Diffstat (limited to 'exports/exports.go')
| -rw-r--r-- | exports/exports.go | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/exports/exports.go b/exports/exports.go index ce6df3a..5d5eb32 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -209,9 +209,11 @@ func ExpiryTimes() (*C.char, *C.char) { } // Deregister cleans up the state for the client. +// // If no client is available or deregistering fails, it returns an error -// This function SHOULD be called when the application exits such that the configuration file is saved correctly -// Note that saving of the configuration file also happens in other cases, such as after getting a VPN configuration +// +// This function SHOULD be called when the application exits such that the configuration file is saved correctly. +// Note that saving of the configuration file also happens in other cases, such as after getting a VPN configuration. // Thus it is often not problematic if this function cannot be called due to a client crash // //export Deregister @@ -226,16 +228,24 @@ func Deregister() *C.char { } // AddServer adds a server to the eduvpn-common server list -// c is the cookie that is used for cancellation. Create a cookie first with CookieNew. This same cookie is also used for replying to state transitions -// _type is the type of server that needs to be added. This type is defined in types/server/server.go Type -// id is the identifier of the string +// `c` is the cookie that is used for cancellation. Create a cookie first with CookieNew. This same cookie is also used for replying to state transitions +// +// `_type` is the type of server that needs to be added. This type is defined in types/server/server.go Type +// +// `id` is the identifier of the string: +// // - In case of secure internet: The organization ID +// // - In case of custom server: The base URL +// // - In case of institute access: The base URL // -// ni stands for non-interactive. If non-zero, any state transitions will not be run. -// This ni flag is useful for preprovisioned servers. For normal usage, you want to set this to zero (meaning: False) +// `ni` stands for non-interactive. If non-zero, any state transitions will not be run. +// +// This `ni` flag is useful for preprovisioned servers. For normal usage, you want to set this to zero (meaning: False) +// // If the server cannot be added it returns the error as types/error/error.go Error +// // Note that the server is removed when an error has occured // The following state callbacks are mandatory to handle: // - OAUTH_STARTED: This indicates that the OAuth procedure has been started, it returns the URL as the data. @@ -259,10 +269,13 @@ func AddServer(c C.uintptr_t, _type C.int, id *C.char, ni C.int) *C.char { // RemoveServer removes a server from the eduvpn-common server list // // `_type` is the type of server that needs to be added. This type is defined in types/server/server.go Type -// `id` is the identifier of the string +// +// `id` is the identifier of the string: // // - In case of secure internet: The organization ID +// // - In case of custom server: The base URL +// // - In case of institute access: The base URL // // If the server cannot be removed it returns the error types/error/error.go Error @@ -347,8 +360,8 @@ func ServerList() (*C.char, *C.char) { // // After getting a configuration, the FSM moves to the GOT_CONFIG state // The return data is the configuration, marshalled as JSON and defined in types/server/server.go Configuration -// If the server cannot be added it returns the error as types/error/error.go Error. -// Note that the server is removed when an error has occured +// +// If the config cannot be retrieved it returns an error as types/error/error.go Error. // // The current state callbacks MUST be handled: // |
