io.eezo.core
Members list
Packages
Type members
Classlikes
Attributes
- Companion
- trait
- Source
- Dispatch.scala
- Supertypes
- Self type
-
Dispatch.type
main, and the dispatch every entry trait shares. Users never name this trait: they extend an layer's entry trait (HttpApp, DbApp) or the umbrella's EezoApp, and each of those chains its own commands in front of commands.
main, and the dispatch every entry trait shares. Users never name this trait: they extend an layer's entry trait (HttpApp, DbApp) or the umbrella's EezoApp, and each of those chains its own commands in front of commands.
core cannot see either layer, so nothing here starts or stops anything: no server, no database, no lifecycle hook. What lives here is only what both layers would otherwise write twice, which is main, the unknown command answer, help over usage, and the --json flag with the one error shape it implies.
Attributes
- Companion
- object
- Source
- Dispatch.scala
- Supertypes
- Known subtypes
The rows of one model, narrowable to the user who owns them.
The rows of one model, narrowable to the user who owns them.
It sits beside Store rather than inside it because the five operations are the vocabulary the derived seven speak and a sixth would be a query language on the seam. Narrowing is a different question: it answers a Store[A] and hands it back, so everything downstream of a narrowing still sees exactly the five, and a derived handler cannot tell a scoped store from a whole one. That is the point. The refusal of a foreign row is then the absence of a row rather than a check somebody has to remember to write.
Both halves of Store implement it, db's through a where on the owner column and http's through a filter, and the generated route table is the only file where both names appear.
Type parameters
- V
-
the owner's own type, which is an
Id[U]for every caller eezo ships. It is a parameter and notId[?]becausedbneeds aColumn[V]to bind it, and a wildcard has none.
Attributes
- Source
- OwnedStore.scala
- Supertypes
Which field of a model records its owner: the name storage knows it by, and the way to read it off a row.
Which field of a model records its owner: the name storage knows it by, and the way to read it off a row.
Two things because two modules need different halves of the same fact. db renders name into the owner condition of four statements, and http calls get to compare a row's owner with the current user, which is what decides whether a show page offers an edit link. Deriving one from the other is not possible in either direction: a getter cannot be read for a column name at runtime, and a name cannot be turned into a typed getter without a mirror.
It is built at compile time, from a field selector, so the name is the model's own field and not a string somebody typed. See io.eezo.auth.Guard's owning.
Attributes
- Source
- OwnedStore.scala
- Supertypes
The rows of one model, read and written by the derived seven.
The rows of one model, read and written by the derived seven.
It lives in core because it is the one seam http and db have to meet at, and they are siblings that never see each other: db produces one of these from a Table[A], http consumes one in io.eezo.http.Resource, and the generated route table is the only place both names appear. A trait rather than a class, because two implementations exist and nobody writes a third by hand.
Its charter is the vocabulary the derivation can speak, not eezo's data-access API. Five operations, one per thing the seven routes do, and no sixth. A route that wants a filter, a sort or a page is a handwritten route using db's query DSL directly, and it never touches this trait. Widening it to serve one such route would put a second query language in the most expensive module in the build to change.
Nothing here throws. A missing row is a false or a None, which io.eezo.http.Resource turns into a 404; an implementation that raised would be deciding an HTTP status one layer below the layer that knows what HTTP is.
Type parameters
- A
-
the model, whose key is
Id[A]. Per model rather than one instance holding every model's rows: a store that needs telling which bucket to look in is a store that cannot be typed.
Attributes
- Source
- Store.scala
- Supertypes
- Known subtypes
-
class Scoped[A]
Types
A model's key: a UUID that remembers what it identifies.
A model's key: a UUID that remembers what it identifies.
It lives in core because both sides of the framework need it and neither can see the other. db stores one, http puts one in a path and in a form, and db and http are siblings above core. The type itself therefore knows about neither: each instance lives downstream, in its own typeclass's companion, still companion-resolvable because a given in the typeclass's companion is found just as reliably as one in the type's.
The phantom T is what makes Id[Author] and Id[Book] different types while both are a bare UUID at runtime, so passing one where the other belongs does not compile.
Attributes
- Source
- Id.scala