summaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
authorJeroen Wijenbergh <jeroenwijenbergh@protonmail.com>2022-04-25 16:43:36 +0200
committerjwijenbergh <jeroenwijenbergh@protonmail.com>2022-04-25 16:43:36 +0200
commitd566499c3c6bcb8945bc9f0253508cc273582880 (patch)
tree66b4ab4a95591c646a24281e9fd7074e5339625f /docs/src
parenta20beedd3b35b974d7bce325cc3f1959489e7443 (diff)
Docs: Update with more sections
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/SUMMARY.md10
-rw-r--r--docs/src/about.md2
-rw-r--r--docs/src/api/README.md1
-rw-r--r--docs/src/api/go/README.md1
-rw-r--r--docs/src/api/go/functions.md1
-rw-r--r--docs/src/api/python/README.md1
-rw-r--r--docs/src/api/python/functions.md1
-rw-r--r--docs/src/gettingstarted/README.md2
-rw-r--r--docs/src/gettingstarted/building.md (renamed from docs/src/installation.md)44
-rw-r--r--docs/src/gettingstarted/debugging.md1
-rw-r--r--docs/src/gettingstarted/testing.md40
11 files changed, 68 insertions, 36 deletions
diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md
index 211d9eb..58509f8 100644
--- a/docs/src/SUMMARY.md
+++ b/docs/src/SUMMARY.md
@@ -1,4 +1,12 @@
# Summary
- [About](./about.md)
-- [Installation](./installation.md)
+- [Getting Started](./gettingstarted/README.md)
+ - [Building](./gettingstarted/building.md)
+ - [Testing](./gettingstarted/testing.md)
+ - [Debugging](./gettingstarted/debugging.md)
+- [API](./api/README.md)
+ - [Go](./api/go/README.md)
+ - [Functions](./api/go/functions.md)
+ - [Python](./api/python/README.md)
+ - [Functions](./api/python/functions.md)
diff --git a/docs/src/about.md b/docs/src/about.md
index ac61279..4631166 100644
--- a/docs/src/about.md
+++ b/docs/src/about.md
@@ -1,5 +1,5 @@
# About
-This chapter contains background information for the library.
+This chapter contains background information for the library. We give a general introduction to eduVPN and explain what problems this library aims to solve.
## eduVPN introduction
eduVPN-common is a library for [eduVPN](https://www.eduvpn.org/), which is a VPN by [Surf](https://www.surf.nl) for research institutions such as Universities. Each institution that uses eduVPN has its own server. To discover these servers and establish a VPN connection with them, eduVPN clients are used. eduVPN has clients for each common platform:
diff --git a/docs/src/api/README.md b/docs/src/api/README.md
new file mode 100644
index 0000000..5932792
--- /dev/null
+++ b/docs/src/api/README.md
@@ -0,0 +1 @@
+# API
diff --git a/docs/src/api/go/README.md b/docs/src/api/go/README.md
new file mode 100644
index 0000000..452b575
--- /dev/null
+++ b/docs/src/api/go/README.md
@@ -0,0 +1 @@
+# Go
diff --git a/docs/src/api/go/functions.md b/docs/src/api/go/functions.md
new file mode 100644
index 0000000..0c5faf5
--- /dev/null
+++ b/docs/src/api/go/functions.md
@@ -0,0 +1 @@
+# Functions
diff --git a/docs/src/api/python/README.md b/docs/src/api/python/README.md
new file mode 100644
index 0000000..452b575
--- /dev/null
+++ b/docs/src/api/python/README.md
@@ -0,0 +1 @@
+# Go
diff --git a/docs/src/api/python/functions.md b/docs/src/api/python/functions.md
new file mode 100644
index 0000000..0c5faf5
--- /dev/null
+++ b/docs/src/api/python/functions.md
@@ -0,0 +1 @@
+# Functions
diff --git a/docs/src/gettingstarted/README.md b/docs/src/gettingstarted/README.md
new file mode 100644
index 0000000..152d491
--- /dev/null
+++ b/docs/src/gettingstarted/README.md
@@ -0,0 +1,2 @@
+# Getting Started
+This chapter contains the steps to get started with the Go library. You will learn how to build the library, what the structure of the library is and how to test the code.
diff --git a/docs/src/installation.md b/docs/src/gettingstarted/building.md
index 3a823cd..8747cd7 100644
--- a/docs/src/installation.md
+++ b/docs/src/gettingstarted/building.md
@@ -1,8 +1,6 @@
-# Installation and building
-This chapter contains the instructions to build and install the Go library.
-## Dependencies
-This section contains the dependencies needed to build the library on Linux and Windows
-### Linux
+# Building
+To build the Go library, you need the dependencies for your system installed. We will go over the needed dependencies for Linux and Windows. Afterwards, we explain the basic commands to build the library.
+## Linux
To build the GO shared library using Linux you need the following dependencies:
- [Go](https://go.dev/doc/install) 1.15 or later
@@ -10,7 +8,7 @@ To build the GO shared library using Linux you need the following dependencies:
- [GNU Make](https://www.gnu.org/software/make/)
- Dependencies for each wrapper you are interested in
-### Windows
+## Windows
On Windows, you can install gcc and make (or even Go) via MinGW or Cygwin or use WSL. For MinGW:
1. [Install MinGW](https://www.msys2.org/#installation) (you don't need to install any extra packages yet) and open some
@@ -30,16 +28,16 @@ On Windows, you can install gcc and make (or even Go) via MinGW or Cygwin or use
terminal: `path/to/msys64/msys2_shell.cmd -mingw32 -defterm -no-start -use-full-path`
3. Run the make commands in the project directory
-## Building
+## Commands
To build the shared library for the current platform issue the following command in the root directory:
-```shell
+```bash
make
```
Build shared library for specified OS & architecture (example):
-```shell
+```bash
make GOOS=windows GOARCH=386
```
@@ -49,38 +47,16 @@ Results will be output in `exports/lib/`.
Usually you will need to specify the compiler when cross compiling, for example:
-```shell
+```bash
make GOOS=windows GOARCH=amd64 CC=x86_64-w64-mingw32-gcc
```
For example, you can cross compile for Windows from Linux using [MinGW-w64](https://www.mingw-w64.org/downloads/).
-Test Go code:
-
-```shell
-make test-go
-```
-
-## Testing
-
-To test the wrappers, issue the following command in a shell (you will need compilers for all wrappers if you do this):
-
-```shell
-make test-wrappers
-```
-
-Specify `-j` to execute tests in parallel. You can specify specific wrappers to test by appending
-e.g. `WRAPPERS="csharp php"`.
-
-Test both:
-
-```shell
-make test
-```
-
+### Cleaning
Clean built libraries and wrapper builds:
-```shell
+```bash
make -j clean
```
diff --git a/docs/src/gettingstarted/debugging.md b/docs/src/gettingstarted/debugging.md
new file mode 100644
index 0000000..1e584c9
--- /dev/null
+++ b/docs/src/gettingstarted/debugging.md
@@ -0,0 +1 @@
+# Debugging
diff --git a/docs/src/gettingstarted/testing.md b/docs/src/gettingstarted/testing.md
new file mode 100644
index 0000000..f89757e
--- /dev/null
+++ b/docs/src/gettingstarted/testing.md
@@ -0,0 +1,40 @@
+# Testing
+To test the Go code, issue the following command in a shell
+
+## Testing the Go code
+```bash
+make test-go
+```
+
+Note that this runs the tests without any server interaction. To run the tests with an eduVPN server you need to specify environment variables:
+
+```bash
+SERVER_URI="eduvpn.example.com" PORTAL_USER="example" PORTAL_PASS="example" make test-go
+```
+
+If you have [Docker](https://www.docker.com/get-started/) installed and [Docker-compose](https://docs.docker.com/compose/install/) you can use a convenient helper script which starts up two containers
+- An eduvpnserver for testing
+- A Go container that builds and runs the test-suite
+
+```bash
+PORTAL_USER="example" PORTAL_PASS="example" ./ci/startcompose.sh
+```
+
+This script is also used in the continuous integration, so we recommend to run this before you submit any changes.
+## Testing the wrappers
+To test the wrappers, issue the following command in a shell (you will need compilers for all wrappers if you do this):
+
+```bash
+make test-wrappers
+```
+
+Specify `-j` to execute tests in parallel. You can specify specific wrappers to test by appending
+e.g. `WRAPPERS="csharp php"`.
+
+## Test everything
+To test all the code at once, issue the following command:
+```bash
+make test
+```
+
+This accepts the same environment variables as we have explained before.