Documentation
¶
Overview ¶
Package pagerender assembles the engine, the modules and the data layer into the callbacks one request renders with.
Index ¶
- func ResolveLinks(ctx context.Context, conn *db.DB, result renderer.Result) ([]db.ArticleLink, error)
- type Deps
- type Env
- func (e *Env) Backlinks(source string, info renderer.PageInfo, cb *callbacks.Callbacks) ([]db.ArticleLink, error)
- func (e *Env) Callbacks(vars *page.Vars, pc *page.Context) *callbacks.Callbacks
- func (e *Env) CodeAndHTML(source string, info renderer.PageInfo, cb *callbacks.Callbacks, ...) (renderer.Parts, error)
- func (e *Env) HTML(source string, info renderer.PageInfo, cb *callbacks.Callbacks, ...) (renderer.Result, error)
- func (e *Env) Message(source string) (string, error)
- func (e *Env) ModuleAPI(pc *page.Context, name, method string, params map[string]string) (wikijson.Object, error)
- func (e *Env) PageInfo(source *db.Article) (renderer.PageInfo, error)
- func (e *Env) SetClient(r *http.Request)
- func (e *Env) Text(source string, info renderer.PageInfo, cb *callbacks.Callbacks, ...) (renderer.Result, error)
- func (e *Env) Vars(of *db.Article) *page.Vars
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Deps ¶
type Deps struct {
DB *db.DB
Engine renderer.Renderer
Icons roles.IconLoader
Trust *proxyheader.Trust
}
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
func (*Env) Backlinks ¶
func (e *Env) Backlinks(source string, info renderer.PageInfo, cb *callbacks.Callbacks) ([]db.ArticleLink, error)
ftml answers with the pages a source pulls in and the pages it points at, in that order. Handing the two back swapped would invert every backlink on the site.
func (*Env) CodeAndHTML ¶
func (*Env) SetClient ¶
Only the layer holding the proxy trust can say which forwarded address to believe.