Documentation
¶
Overview ¶
Package content is the module manifest: the pages and posts a tenant's public site is made of.
It is the shape every module follows: contracts/, internal/, and one exported function taking a struct of typed dependencies and returning a module.Module. Two absences are decisions rather than omissions.
There are no versions. A history table, a diff, a restore and a retention rule are a module of their own, and the private catalogue has one; what a reference architecture owes is the lifecycle — draft, published, archived — and the events that announce it.
There is no stored HTML. The body is Markdown and the public route renders it on read, through goldmark with raw HTML left out and bluemonday over the result, so a policy that tightens applies to everything ever written instead of to whatever is saved next. See internal/render.go.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct{}
Deps is what this module cannot make for itself, and it is empty: content belongs to a tenant by carrying its id, which row-level security matches on, and the author comes off the request's own context. It is a struct rather than no parameter so that the day it needs something, every call site gains a named field instead of a new argument.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package contracts is everything another module, an app or a test may know about content: the entity, the events, the permissions and the Service interface.
|
Package contracts is everything another module, an app or a test may know about content: the entity, the events, the permissions and the Service interface. |
|
contenttest
Package contenttest is the conformance suite for contracts.Service, and a fake that passes it.
|
Package contenttest is the conformance suite for contracts.Service, and a fake that passes it. |
|
Package internal is every implementation of the content module.
|
Package internal is every implementation of the content module. |