We are depending on a particular commit from LaTiS 2 on GitHub.
After the tag for the next release is pushed I'll update the commit here to point to that tag. Ideally we'll just depend on tagged releases of LaTiS 2.
In short, CatalogAlgebra is a typeclass that defines the operations one can do to the catalog. In our case, the only operation is to get the catalog.
"Interpreters" of this algebra implement the operation.
Implement the catalog endpoint in terms of CatalogAlgebra.
Rather than relying on a concrete implementation, we can rely on the abstract operations provided by the algebra and let the interpreters decide what actually gets done.
Define HapiInterpreter.
This is intended to be the trait that all interpreters (LaTiS 2, LaTiS 3, something else) extend.
Right now there is only the catalog algebra, but this will include algebras for the other endpoints as they are added.
Construct HapiService with HapiInterpreter, construct CatalogService with a CatalogAlgebra (the interpreter for the catalog algebra).
In order to construct working instances of these things you need to provide the interpreter you want to use.
The default is to use a no-op interpreter that currently returns an empty catalog.
Add Latis2Interpreter.
This implements the catalog algebra using LaTiS 2's CatalogReader.
If you swap the no-op interpreter for this one, you can read TSML from your local file system and get a catalog.
Overview of changes
CatalogAlgebra
.CatalogAlgebra
is a typeclass that defines the operations one can do to the catalog. In our case, the only operation is to get the catalog.catalog
endpoint in terms ofCatalogAlgebra
.HapiInterpreter
.HapiService
withHapiInterpreter
, constructCatalogService
with aCatalogAlgebra
(the interpreter for the catalog algebra).Latis2Interpreter
.CatalogReader
.Closes #7.