A realization as I was implementing everything, was that the billy.Filesystem from go-git is a useful lowest-common denominator abstraction for a writable filesystem. It should work nicely with the git.FilesystemStore implementation.
To support testing PR includes implementations of both:
FilesystemStore
Controller
The new package pkg/mem includes a dummy in-memory FilesystemStore.
It lets the user register implementations of billy.Filesystem under a source and revision.
The new package pkg/controllers/template includes an in-cup implementation of a Controller.
It uses (eventually) configurable text/template instances to derive where a resource should live on the target filesystem.
I have a feeling this can be extended so that it is directly configurable from cup config, allowing us to support some basic functionality without a WASM implementation.
Fixes #12
Implements a first stab at
*api.Server
.This includes all the planned routes:
A realization as I was implementing everything, was that the
billy.Filesystem
fromgo-git
is a useful lowest-common denominator abstraction for a writable filesystem. It should work nicely with thegit.FilesystemStore
implementation.To support testing PR includes implementations of both:
The new package
pkg/mem
includes a dummy in-memoryFilesystemStore
. It lets the user register implementations ofbilly.Filesystem
under asource
andrevision
.The new package
pkg/controllers/template
includes an in-cup implementation of a Controller. It uses (eventually) configurabletext/template
instances to derive where a resource should live on the target filesystem. I have a feeling this can be extended so that it is directly configurable fromcup
config, allowing us to support some basic functionality without a WASM implementation.