Commit Graph

9 Commits

Author SHA1 Message Date
Levi Neely edc38f7353 fsedsl: simplify README usage section 2026-08-04 12:48:39 +02:00
Levi Neely aaacae40a8 fs: simplify adapter to type aliases only
- Remove wrapper functions from adapter.go (212 → 91 lines)
- Delete redundant adapter_test.go (fsedsl has 94.8% coverage)
- Add local function aliases in spec.go for clean EDSL usage
- Update handlers.go, newroot.go, tree_test.go to use fsedsl directly
- Update fsedsl README with cleaner integration pattern
2026-08-04 12:47:17 +02:00
Levi Neely ae6b833d1e fsedsl: remove Adapter, use generic functions directly
The Adapter was pure boilerplate - every method just delegated to the
package-level generic function. Removing it simplifies the API:

- Delete fsedsl/adapter.go
- Update fs/adapter.go to call fsedsl functions directly
- Update README.md to document direct usage
- Remove adapter tests (now redundant)

Coverage remains at 94.8%.
2026-08-04 12:33:03 +02:00
Levi Neely 44f5238538 fsedsl: comprehensive test coverage (95.8%)
- Add tests for Adapter methods (NewAdapter, all wrapper methods)
- Add tests for all NodeOption functions (Stream, BlockOnce, Request,
  CreateFile, RemoveNode, StatOverride, UID, GID, Alias, Bind)
- Add tests for Tree mount/child/split operations
- Add tests for FileConfig methods and mode validation
- Add tests for SyntheticFileInfo and SyntheticEntry
- Add tests for builder delete/rename operations
- Add tests for blocking/streaming read modes in openLeaf
- Add tests for validation panics
- Add tree_test.go for filesystem-backed Tree operations:
  - Create, Delete, Rename, MkdirAll
  - ReadOnly mode enforcement
  - Union directories
  - Child delegation
  - Resolver and opener fallbacks

Coverage improved from 45.5% to 95.8%
2026-08-04 12:27:47 +02:00
Levi Neely 6b5b2830ef Make fsedsl description protocol-agnostic
The EDSL is not specific to 9P - it produces a generic Tree
that works with any filesystem protocol or as in-memory storage.
2026-08-04 12:11:36 +02:00
Levi Neely 0d50898bd7 Fix fsedsl installation instructions
The library is embedded in ollie, not published separately yet.
Document how to use replace directives to import it.
2026-08-04 12:10:01 +02:00
Levi Neely 5ec5f31135 Update fsedsl README with integration guide
- Add step-by-step integration guide for other projects
- Document the adapter pattern with complete examples
- Add API reference with tables for constructors and options
- Document Binding struct and Tree operations
- Link to ollie/fs/adapter.go as real-world example
2026-08-04 12:09:33 +02:00
Levi Neely 6c232c7bb7 Add explicit Adapter pattern to fsedsl
- Add Adapter[Ctx] type that provides all EDSL methods specialized for a context type
- NewAdapter[Ctx]() creates an adapter instance
- Update ollie/fs/edsl.go to use the adapter explicitly
- Update README with adapter-based examples

The adapter makes it explicit that we're building a type-specialized
interface to the generic EDSL library.
2026-08-04 12:06:44 +02:00
Levi Neely 882fc598d4 Extract EDSL to fsedsl/ library
- Create fsedsl/ as embedded library with generic types:
  - FsNodeDecl[Ctx], Binding[Ctx], NodeOption[Ctx]
  - BuildTree[Ctx], GenerateHelp[Ctx]
  - Tree, File, FileConfig, SyntheticFileInfo

- Update ollie/fs to use fsedsl via type aliases:
  - type FsNodeDecl = fsedsl.FsNodeDecl[HandlerCtx]
  - Wrapper functions for constructors and options

- Migrate binding functions to Applier pattern:
  - Binding.Applier replaces direct field assignment
  - Cleanly separates EDSL mechanics from domain types

- Add replace directive in go.mod for local module

The library can be extracted to a separate repo later by
changing the module path and removing the replace directive.
2026-08-04 12:02:32 +02:00