Documentation ¶
Index ¶
- type ApplyMiddleware
- type Buildable
- type Builder
- type CConsole
- type CEnjinBlock
- type CEnjinFeature
- func (f *CEnjinFeature) NjnCheckClass(tagClass NjnClass) (allow bool)
- func (f *CEnjinFeature) NjnCheckTag(tagName string) (allow bool)
- func (f *CEnjinFeature) NjnClassAllowed() (allowed NjnClass, ok bool)
- func (f *CEnjinFeature) NjnTagsAllowed() (allowed []string, ok bool)
- func (f *CEnjinFeature) NjnTagsDenied() (denied []string, ok bool)
- type CEnjinField
- type CFeature
- func (f *CFeature) Build(b Buildable) (err error)
- func (f *CFeature) Depends() (deps Tags)
- func (f *CFeature) Init(this interface{})
- func (f *CFeature) Make() Feature
- func (f *CFeature) Self() (self Feature)
- func (f *CFeature) Setup(enjin Internals)
- func (f *CFeature) Shutdown()
- func (f *CFeature) Startup(ctx *cli.Context) (err error)
- func (f *CFeature) Tag() (tag Tag)
- func (f *CFeature) This() (this interface{})
- type CanSetupInternals
- type Console
- type ContentSecurityPolicyModifier
- type DataRestrictionHandler
- type Database
- type EmailProvider
- type EmailSender
- type EnjinBlock
- type EnjinFeature
- type EnjinField
- type EnjinRenderer
- type EnjinRunner
- type EnjinSystem
- type Feature
- type FileProvider
- type HeadersModifier
- type Internals
- type MakeConsole
- type MakeFeature
- type MenuProvider
- type Middleware
- type MiddlewareFn
- type NjnClass
- type NotifyHook
- type OutputTransformer
- type OutputTranslator
- type PageContextFilterFn
- type PageContextModifier
- type PageProvider
- type PageRestrictionHandler
- type PageTypeProcessor
- type PermissionsPolicyModifier
- type Processor
- type ReqProcessFn
- type RequestFilter
- type RequestFilterFn
- type RequestModifier
- type RequestRewriter
- type RootInternals
- type Runner
- type ServePathFeature
- type Service
- type System
- type Tag
- type Tags
- type TransformOutputFn
- type TranslateOutputFn
- type UseMiddleware
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplyMiddleware ¶ added in v0.1.0
type Builder ¶
type Builder interface { SiteTag(key string) Builder SiteName(name string) Builder SiteTagLine(title string) Builder SiteLanguageMode(mode lang.Mode) Builder SiteCopyrightName(name string) Builder SiteCopyrightNotice(notice string) Builder SiteDefaultLanguage(tag language.Tag) Builder SiteSupportedLanguages(tags ...language.Tag) Builder SiteLanguageDisplayNames(names map[language.Tag]string) Builder // Set a custom context key with value Set(key string, value interface{}) Builder // AddHtmlHeadTag adds a custom (singleton) HTML tag to the <head> section // of the page output, example meta tag: // AddHtmlHeadTag("meta",map[string]string{"name":"og:thing","content":"stuff"}) AddHtmlHeadTag(name string, attr map[string]string) Builder // AddDomains restricts inbound requests to only the domain names given AddDomains(domains ...string) Builder // AddFeatureNotes appends bullet-pointed notes to the CLI App's main // description field AddFeatureNotes(tag Tag, notes ...string) Builder // AddFlags adds custom command line flags AddFlags(flags ...cli.Flag) Builder // AddCommands adds custom command line commands AddCommands(commands ...*cli.Command) Builder // AddConsole adds custom command line go-curses consoles (ctk.Window) AddConsole(c Console) Builder // AddFeature includes the given feature within the built Enjin AddFeature(f Feature) Builder // AddRouteProcessor adds the given route processor to the Enjin route // processing middleware AddRouteProcessor(route string, processor ReqProcessFn) Builder // AddOutputTranslator adds the given output filter (for the given mime type) AddOutputTranslator(mime string, filter TranslateOutputFn) Builder // AddModifyHeadersFn adds the given headers.ModifyHeadersFn function to the // default headers enjin middleware layer AddModifyHeadersFn(fn headers.ModifyHeadersFn) Builder AddNotifyHook(name string, hook NotifyHook) Builder // AddPageFromString is a convenience wrapper around AddPage AddPageFromString(path, raw string) Builder // SetStatusPage overrides specific HTTP error pages, ie: 404 SetStatusPage(status int, path string) Builder // AddTheme includes the given theme within the built Enjin AddTheme(t *theme.Theme) Builder // SetTheme configures the default theme SetTheme(name string) Builder // HotReload enables or disables hot-reloading theme templates and content files HotReload(enabled bool) Builder // Build constructs an Enjin Runner from the Builder configuration Build() Runner }
type CEnjinBlock ¶
type CEnjinBlock struct {
CEnjinFeature
}
type CEnjinFeature ¶
type CEnjinFeature struct {
CFeature
}
func (*CEnjinFeature) NjnCheckClass ¶
func (f *CEnjinFeature) NjnCheckClass(tagClass NjnClass) (allow bool)
func (*CEnjinFeature) NjnCheckTag ¶
func (f *CEnjinFeature) NjnCheckTag(tagName string) (allow bool)
func (*CEnjinFeature) NjnClassAllowed ¶
func (f *CEnjinFeature) NjnClassAllowed() (allowed NjnClass, ok bool)
func (*CEnjinFeature) NjnTagsAllowed ¶
func (f *CEnjinFeature) NjnTagsAllowed() (allowed []string, ok bool)
func (*CEnjinFeature) NjnTagsDenied ¶
func (f *CEnjinFeature) NjnTagsDenied() (denied []string, ok bool)
type CEnjinField ¶
type CEnjinField struct {
CEnjinFeature
}
type CFeature ¶
type CanSetupInternals ¶
type CanSetupInternals interface {
Setup(enjin Internals)
}
type DataRestrictionHandler ¶
type Database ¶
type Database interface { Feature // ListDB returns a sorted list of connected db tags for use with DB and // MustDB ListDB() (tags []string) // DB returns the database connection or an error DB(tag string) (db interface{}, err error) // MustDB returns the database connection or panics on error MustDB(tag string) (db interface{}) }
type EmailProvider ¶ added in v0.1.0
type EmailSender ¶ added in v0.1.0
type EnjinBlock ¶
type EnjinBlock interface { EnjinFeature NjnBlockType() (name string) ProcessBlock(re EnjinRenderer, blockType string, data map[string]interface{}) (html template.HTML, redirect string, err error) PrepareBlock(re EnjinRenderer, blockType string, data map[string]interface{}) (block map[string]interface{}, redirect string, err error) RenderPreparedBlock(re EnjinRenderer, block map[string]interface{}) (html template.HTML, err error) }
type EnjinFeature ¶
type EnjinField ¶
type EnjinField interface { EnjinFeature NjnFieldNames() (tagNames []string) PrepareNjnData(re EnjinRenderer, tagName string, field map[string]interface{}) (data map[string]interface{}, err error) }
type EnjinRenderer ¶
type EnjinRenderer interface { RequestArgv() (reqArgv *argv.RequestArgv) RequestContext() (ctx context.Context) RenderNjnTemplate(tag string, data map[string]interface{}) (html template.HTML, err error) ProcessBlock(data map[string]interface{}) (html template.HTML, redirect string, err error) PrepareBlock(data map[string]interface{}) (block map[string]interface{}, redirect string, err error) RenderPreparedBlock(block map[string]interface{}) (html template.HTML, err error) PrepareGenericBlockData(contentData interface{}) (blockDataContent map[string]interface{}, err error) PrepareGenericBlock(typeName string, data map[string]interface{}) (preparedData map[string]interface{}) GetData() (data interface{}) GetBlockIndex() (index int) GetWithinAside() (within bool) SetWithinAside(within bool) GetCurrentDepth() (depth int) IncCurrentDepth() (depth int) DecCurrentDepth() (depth int) GetHeadingCount() (count int) SetHeadingCount(count int) IncHeadingCount() GetHeadingLevel() (level int) SetHeadingLevel(level int) IncHeadingLevel() DecHeadingLevel() AddFootnote(blockIndex int, field map[string]interface{}) (index int) PrepareFootnotes(blockIndex int) (footnotes []map[string]interface{}, err error) ParseTypeName(data map[string]interface{}) (name string, ok bool) ParseFieldAndTypeName(data interface{}) (field map[string]interface{}, name string, ok bool) PrepareStringTags(text string) (data []interface{}, err error) WalkStringTags(doc *html.Node) (prepared []interface{}) PrepareBlockHeader(content map[string]interface{}) (combined []interface{}, ok bool) ParseBlockHeadingLevel(count, current int, blockData map[string]interface{}) (level, headingReset, headingLevel int) RenderBlockHeader(content map[string]interface{}) (html template.HTML, ok bool) PrepareInlineFieldText(field map[string]interface{}) (combined []interface{}, err error) PrepareInlineFieldList(list []interface{}) (combined []interface{}, err error) PrepareInlineFields(fields []interface{}) (combined []interface{}, err error) PrepareInlineField(field map[string]interface{}) (prepared map[string]interface{}, err error) PrepareContainerFieldText(field map[string]interface{}) (fields []interface{}, err error) PrepareContainerFieldList(list []interface{}) (fields []interface{}, err error) PrepareContainerFields(fields []interface{}) (combined []map[string]interface{}, err error) PrepareContainerField(field map[string]interface{}) (prepared map[string]interface{}, err error) RenderInlineField(field map[string]interface{}) (combined []template.HTML, err error) RenderInlineFields(fields []interface{}) (combined []template.HTML, err error) RenderInlineFieldList(list []interface{}) (html template.HTML, err error) RenderInlineFieldText(field map[string]interface{}) (text template.HTML, err error) RenderContainerField(field map[string]interface{}) (combined []template.HTML, err error) RenderContainerFields(fields []interface{}) (combined []template.HTML, err error) RenderContainerFieldList(list []interface{}) (html template.HTML, err error) RenderContainerFieldText(field map[string]interface{}) (text template.HTML, err error) }
type EnjinRunner ¶
type EnjinSystem ¶
type EnjinSystem interface { InlineFields() (field map[string]EnjinField) ContainerFields() (field map[string]EnjinField) InlineBlocks() (field map[string]EnjinBlock) ContainerBlocks() (field map[string]EnjinBlock) StringTags() (names []string) FindField(tagClass NjnClass, fieldType string) (field EnjinField, ok bool) FindBlock(tagClass NjnClass, blockType string) (block EnjinBlock, ok bool) }
type FileProvider ¶ added in v0.1.0
type HeadersModifier ¶
type HeadersModifier interface {
ModifyHeaders(w http.ResponseWriter, r *http.Request)
}
type Internals ¶
type Internals interface { Service site.Enjin Self() (self interface{}) Features() (features []Feature) Pages() (pages map[string]*page.Page) Theme() (theme string) Theming() (theming map[string]*theme.Theme) Headers() (headers []headers.ModifyHeadersFn) Domains() (domains []string) Consoles() (consoles map[Tag]Console) Processors() (processors map[string]ReqProcessFn) Translators() (translators map[string]TranslateOutputFn) Transformers() (transformers map[string]TransformOutputFn) Slugsums() (enabled bool) DB(tag string) (db interface{}, err error) MustDB(tag string) (db interface{}) SpecificDB(fTag Tag, tag string) (db interface{}, err error) MustSpecificDB(fTag Tag, tag string) (db interface{}) }
type MakeConsole ¶
type MakeConsole interface {
Make() Console
}
type MakeFeature ¶
type MakeFeature interface {
Make() Feature
}
type MenuProvider ¶
type Middleware ¶
type NotifyHook ¶
type NotifyHook = func(format string, argv ...interface{})
type OutputTransformer ¶
type OutputTranslator ¶
type PageContextFilterFn ¶
type PageContextModifier ¶
type PageProvider ¶
type PageRestrictionHandler ¶
type PageTypeProcessor ¶
type PermissionsPolicyModifier ¶
type PermissionsPolicyModifier interface {
ModifyPermissionsPolicy(policy permissions.Policy, r *http.Request) (modified permissions.Policy)
}
type ReqProcessFn ¶
type RequestFilter ¶
type RequestFilterFn ¶
type RequestModifier ¶
type RequestModifier interface {
ModifyRequest(w http.ResponseWriter, r *http.Request)
}
type RequestRewriter ¶
type RootInternals ¶
type ServePathFeature ¶ added in v0.1.0
type Service ¶
type Service interface { Prefix() (prefix string) Context() (ctx context.Context) GetTheme() (t *theme.Theme, err error) MustGetTheme() (t *theme.Theme) ThemeNames() (names []string) ServerName() (name string) ServiceInfo() (listen string, port int) ContentSecurityPolicy() (handler *csp.PolicyHandler) PermissionsPolicy() (handler *permissions.PolicyHandler) ServeRedirect(destination string, w http.ResponseWriter, r *http.Request) Serve204(w http.ResponseWriter, r *http.Request) Serve401(w http.ResponseWriter, r *http.Request) ServeBasic401(w http.ResponseWriter, r *http.Request) Serve403(w http.ResponseWriter, r *http.Request) Serve404(w http.ResponseWriter, r *http.Request) Serve405(w http.ResponseWriter, r *http.Request) Serve500(w http.ResponseWriter, r *http.Request) ServeNotFound(w http.ResponseWriter, r *http.Request) ServeInternalServerError(w http.ResponseWriter, r *http.Request) ServeStatusPage(status int, w http.ResponseWriter, r *http.Request) ServePage(p *page.Page, w http.ResponseWriter, r *http.Request) (err error) ServePath(urlPath string, w http.ResponseWriter, r *http.Request) (err error) ServeData(data []byte, mime string, w http.ResponseWriter, r *http.Request) MatchQL(query string) (pages []*page.Page) MatchStubsQL(query string) (stubs []*matter.PageStub) SelectQL(query string) (selected map[string]interface{}) CheckMatchQL(query string) (pages []*page.Page, err error) CheckMatchStubsQL(query string) (stubs []*matter.PageStub, err error) CheckSelectQL(query string) (selected map[string]interface{}, err error) FindPage(tag language.Tag, url string) (p *page.Page) FindFile(path string) (data []byte, mime string, err error) FindEmailAccount(account string) (emailSender EmailSender) SendEmail(account string, message *gomail.Message) (err error) Notify(tag string) NotifyF(tag, format string, argv ...interface{}) }
type Tag ¶
type Tag string
Tag is the primary identifier type for enjin Feature implementations
const NotImplemented Tag = "NotImplemented"
func (Tag) ScreamingKebab ¶ added in v0.1.0
ScreamingKebab returns the Tag as a SCREAMING-KEBAB-CASED string
func (Tag) ScreamingSnake ¶ added in v0.1.0
ScreamingSnake returns the Tag as a SCREAMING_SNAKE_CASED string
type Tags ¶
type Tags []Tag
func SortedFeatureTags ¶ added in v0.1.0
SortedFeatureTags returns a sortorder.Natural list of Tag keys
func StringsAsTags ¶ added in v0.1.0
StringsAsTags returns a list of Tags based on the names given
type TransformOutputFn ¶
type TranslateOutputFn ¶
type UseMiddleware ¶ added in v0.1.0
type UseMiddleware interface {
Use(s System) MiddlewareFn
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.