Documentation
¶
Index ¶
- Constants
- Variables
- type Callbacks
- func (c *Callbacks) EvaluateExpression(source string) (renderer.ExpressionResult, error)
- func (c *Callbacks) GetHTMLInjectedCode(id string) (string, error)
- func (c *Callbacks) GetI18nMessage(id string) (string, error)
- func (c *Callbacks) GetPageInfo(refs []string) ([]renderer.PartialPageInfo, error)
- func (c *Callbacks) IncludePages(refs []renderer.IncludeRef) ([]renderer.FetchedPage, error)
- func (c *Callbacks) ModuleHasBody(name string) (bool, error)
- func (c *Callbacks) ModuleIsInline(name string) (bool, error)
- func (c *Callbacks) NextIncludeLevel() (bool, error)
- func (c *Callbacks) NoSuchInclude(fullName string) (string, error)
- func (c *Callbacks) NormalizePageName(fullName string) (string, error)
- func (c *Callbacks) RenderModule(name string, params map[string]string, body string) (string, error)
- func (c *Callbacks) RenderUser(username string, avatar bool) (string, error)
- func (c *Callbacks) SetContext(pc *page.Context)
- func (c *Callbacks) SetPageVars(vars *page.Vars)
- func (c *Callbacks) SetSite(slug string)
- type ModuleError
- type Repository
Constants ¶
const ( MaxIncludeLevel = 10 // Pages that include themselves or each other grow several times over per // level, so the level alone does not keep a render finite. MaxIncludedBytes = 30 << 20 )
Variables ¶
var ( ErrUserNotFound = errors.New("user not found") ErrNoRepository = errors.New("no repository configured") )
Functions ¶
This section is empty.
Types ¶
type Callbacks ¶
type Callbacks struct {
// contains filtered or unexported fields
}
func (*Callbacks) EvaluateExpression ¶
func (c *Callbacks) EvaluateExpression(source string) (renderer.ExpressionResult, error)
func (*Callbacks) GetHTMLInjectedCode ¶
func (*Callbacks) GetPageInfo ¶
func (c *Callbacks) GetPageInfo(refs []string) ([]renderer.PartialPageInfo, error)
func (*Callbacks) IncludePages ¶
func (c *Callbacks) IncludePages(refs []renderer.IncludeRef) ([]renderer.FetchedPage, error)
func (*Callbacks) NextIncludeLevel ¶
func (*Callbacks) NoSuchInclude ¶
A ref that named another wiki gets one answer for every way it can fail, so the block cannot be used to tell a missing page from an unreadable one.
func (*Callbacks) NormalizePageName ¶
func (*Callbacks) RenderModule ¶
func (*Callbacks) RenderUser ¶
func (*Callbacks) SetContext ¶
SetContext hands the modules the page they are rendering into, which is what lets one of them redirect the whole request or set the description.
func (*Callbacks) SetPageVars ¶
SetPageVars names the page whose %%this|x%% an included page reaches. Without it every such name is left standing.
type ModuleError ¶
type ModuleError struct{ Message string }
func (*ModuleError) Error ¶
func (e *ModuleError) Error() string
type Repository ¶
type Repository interface {
RenderModule(pc *page.Context, name string, params map[string]string, body string) (string, error)
RenderUser(username string, avatar bool) (string, error)
PageInfo(refs []string) ([]renderer.PartialPageInfo, error)
// IncludeSources answers one page per ref, in the order it was asked.
IncludeSources(refs []renderer.IncludeRef) ([]renderer.FetchedPage, error)
}