Files
go-nc-exapp/README.md
T

2.8 KiB

go-nc-exapp

Shared Go library for Nextcloud ExApp Services: AppAPI authentication, OCS JSON calls, per-user ExApp preferences, Notifications, Users and Groups, an optional Required Groups Access Gate, an optional App navigation shell, and a Dialog.

Import: gitea.neitzel.de/konrad/go-nc-exapp (package gonexapp).

go get gitea.neitzel.de/konrad/go-nc-exapp

Included

Excluded

  • ExApp lifecycle HTTP routes (/heartbeat, /enabled, and /init). The Access Gate skips these by default and does not implement them
  • HaRP listen, serve(), and unix-socket bootstrap
  • Top-menu, script, and iframe UI registration
  • WebDAV and file storage (see go-nc-files)
  • Visit folder resolution (see go-nc-files)
  • Fan-out notifications (SendToGroup, SendToAdmins)
  • A library default admin user for directory OCS (callers pass that user with WithUser)

Testing

Unit tests use httptest fake OCS servers. No live Nextcloud is required.

go test ./... fails when docs/api.md does not match the exported API. Regenerate it with:

UPDATE_API_DOCS=1 go test -run TestAPIDoc -count=1

Runnable package examples: go test -run Example.

  • go-nc-files — WebDAV, Working Folder, Saved Default, Visit resolution
  • Workspace ADR 0013 — extraction from CheckDNS
  • Workspace ADR docs/adr/go-nc-exapp/0001-required-groups-access-gate.md — Access Gate
  • Workspace ADR docs/adr/go-nc-exapp/0002-users-and-groups-as-requesting-user.md — directory OCS as the requesting user
  • Workspace ADR docs/adr/go-nc-exapp/0003-app-navigation-shell.md — App navigation shell
  • Workspace ADR docs/adr/go-nc-exapp/0004-dialog-in-exapp-page.md — Dialog