diff options
Diffstat (limited to 'exports')
| -rw-r--r-- | exports/Makefile | 2 | ||||
| -rw-r--r-- | exports/exports.go | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/exports/Makefile b/exports/Makefile index a23f211..86dbec2 100644 --- a/exports/Makefile +++ b/exports/Makefile @@ -16,7 +16,7 @@ endif # Build shared library and remove lib prefix (if any) from header name # GOOS and GOARCH envvars are set by common.mk # This extra target prevents unnecessary rebuild -lib/$(GOOS)/$(GOARCH)/$(LIB_FILE): exports.go ../src/verify.go +lib/$(GOOS)/$(GOARCH)/$(LIB_FILE): exports.go ../src/*.go CGO_ENABLED=1 go build -o $@ -buildmode=c-shared $< mv lib/$(GOOS)/$(GOARCH)/$(LIB_PREFIX)$(LIB_NAME).h lib/$(GOOS)/$(GOARCH)/$(LIB_NAME).h || true # Normalize header name diff --git a/exports/exports.go b/exports/exports.go index 9ea8cba..43dfb9e 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -5,6 +5,19 @@ import "C" import "github.com/jwijenbergh/eduvpn-common/src" // Functions here should probably not take string parameters, see https://pkg.go.dev/cmd/cgo#hdr-C_references_to_Go +// GetOrganizationsList gets the list of organizations from the disco server. +// Returns the unix timestamp of the data. This is used as key for looking up data. +//export GetOrganizationsList +func GetOrganizationsList() uint64 { + return eduvpn.GetOrganizationsList() +} + +// GetServerList gets the list of servers from the disco server. +// Returns the unix timestamp of the data. This is used as key for looking up data. +//export GetServerList +func GetServerList() uint64 { + return eduvpn.GetServerList() +} // Verify verifies a signature on a JSON file. See eduvpn.Verify for more details. // It returns 0 for a valid signature and a nonzero eduvpn.VerifyErrorCode otherwise. |
