50 lines
1.8 KiB
Markdown
50 lines
1.8 KiB
Markdown
# go-nc-files
|
||
|
||
Shared Go library for Nextcloud ExApp Services: a User Files seam (local disk and WebDAV), Saved Default path storage, and Visit-scoped Working Folder resolution.
|
||
|
||
Import: `gitea.neitzel.de/konrad/go-nc-files` (package `goncfiles`).
|
||
|
||
```bash
|
||
go get gitea.neitzel.de/konrad/go-nc-files
|
||
```
|
||
|
||
Depends on [go-nc-exapp](https://gitea.neitzel.de/konrad/go-nc-exapp) for AppAPI credentials on WebDAV.
|
||
|
||
- [Guide](docs/guide.md) — how to call each capability
|
||
- [API](docs/api.md) — every exported symbol
|
||
- [Domain language](CONTEXT.md)
|
||
|
||
## Included
|
||
|
||
- [Files seam](docs/guide.md#files-seam) — `Root` and `Folder`
|
||
- [Local](docs/guide.md#local) — filesystem-backed User Files Root
|
||
- [WebDAVRoot](docs/guide.md#webdavroot) — Nextcloud Files over WebDAV
|
||
- [CleanRel](docs/guide.md#cleanrel) — User Files Root–relative paths
|
||
- [RequireBasename](docs/guide.md#requirebasename) — child file names
|
||
- [DefaultPathStore](docs/guide.md#defaultpathstore) — Saved Default path
|
||
- [Visit](docs/guide.md#visit) — Working Folder for one opening
|
||
|
||
## Excluded
|
||
|
||
- ExApp lifecycle HTTP routes and HaRP bootstrap (see **go-nc-exapp**)
|
||
- AppAPI preference OCS wiring (the ExApp adapts `gonexapp.AppAPIPreferences` to `DefaultPathStore`)
|
||
- Catalog, DNS, or product-specific file semantics
|
||
- Recursive tree walks and Nextcloud numeric file IDs
|
||
|
||
## Testing
|
||
|
||
Unit tests use a temporary local root and `httptest` for WebDAV. No live Nextcloud is required.
|
||
|
||
`go test ./...` fails when [`docs/api.md`](docs/api.md) does not match the exported API. Regenerate it with:
|
||
|
||
```bash
|
||
UPDATE_API_DOCS=1 go test -run TestAPIDoc -count=1
|
||
```
|
||
|
||
Runnable package examples: `go test -run Example`.
|
||
|
||
## Related
|
||
|
||
- **go-nc-exapp** — AppAPI credentials and OCS preferences
|
||
- Workspace ADR 0013 — extraction from CheckDNS
|