Documentation ¶
Index ¶
- Constants
- func AddErrorNotice(r *http.Request, dismiss bool, message string, argv ...interface{}) (modified *http.Request)
- func AddImportantNotice(r *http.Request, dismiss bool, message string, argv ...interface{}) (modified *http.Request)
- func AddInfoNotice(r *http.Request, dismiss bool, message string, argv ...interface{}) (modified *http.Request)
- func AddUserNotices(r *http.Request, notes ...*UserNotice) (modified *http.Request)
- func AddWarnNotice(r *http.Request, dismiss bool, message string, argv ...interface{}) (modified *http.Request)
- func AnyStubsInStubs(src, tgt PageStubs) (found bool)
- func AsTyped[T interface{}](f Feature) (t T, ok bool)
- func FilterTyped[T interface{}](list Features) (found []T)
- func FilterUserNotices(r *http.Request, fn func(notice *UserNotice) (keep bool)) (m *http.Request)
- func FirstTyped[T interface{}](list Features) (found T)
- func GetTyped[T interface{}](tag Tag, list Features) (f T, err error)
- func MakeRawPage(matter context.Context, content string) (raw string)
- func MustTyped[T interface{}](f Feature) (t T)
- func ParseEditorOpKey(action string) (op, tgt string)
- func ParseEditorOpTargetValue(target string) (tgt, value string)
- func RegisterPageMatcherFuncs(matchers ...MatcherFn)
- type Action
- type Actions
- func (a Actions) Append(actions ...Action) (modified Actions)
- func (a Actions) AsNewlines() (newlines string)
- func (a Actions) Bytes() (data []byte)
- func (a Actions) FilterKnown(other Actions) (known Actions)
- func (a Actions) FilterUnknown(other Actions) (unknown Actions)
- func (a Actions) Has(action Action) (present bool)
- func (a Actions) HasAllOf(actions Actions) (present bool)
- func (a Actions) HasOneOf(actions Actions) (present bool)
- func (a Actions) HasSubject(subject string) (present bool)
- func (a Actions) HasVerb(verb string) (present bool)
- func (a Actions) Len() int
- func (a Actions) String() (s string)
- type ApplyMiddleware
- type AuthProvider
- type BaseMakePreset
- type Buildable
- type Builder
- type CConsole
- type CEnjinBlock
- type CEnjinField
- type CFeature
- func (f *CFeature) BaseTag() (pkg Tag)
- func (f *CFeature) Build(b Buildable) (err error)
- func (f *CFeature) CloneBaseFeature() (cloned CFeature)
- func (f *CFeature) Construct(this interface{})
- 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) SetState(state LifeCycleState)
- func (f *CFeature) Setup(enjin Internals)
- func (f *CFeature) Shutdown()
- func (f *CFeature) Startup(ctx *cli.Context) (err error)
- func (f *CFeature) State() (state LifeCycleState)
- func (f *CFeature) Tag() (tag Tag)
- func (f *CFeature) This() (this interface{})
- func (f *CFeature) UsageNotes() (notes []string)
- type CMountPoint
- type CNjnFeature
- func (f *CNjnFeature) NjnCheckClass(tagClass NjnClass) (allow bool)
- func (f *CNjnFeature) NjnCheckTag(tagName string) (allow bool)
- func (f *CNjnFeature) NjnClassAllowed() (allowed NjnClass, ok bool)
- func (f *CNjnFeature) NjnTagsAllowed() (allowed []string, ok bool)
- func (f *CNjnFeature) NjnTagsDenied() (denied []string, ok bool)
- type CPreset
- func (p *CPreset[MakeTypedPreset]) Include(features ...Feature) MakeTypedPreset
- func (p *CPreset[MakeTypedPreset]) IncludeFeature(b Builder, f Feature)
- func (p *CPreset[MakeTypedPreset]) Init(this interface{})
- func (p *CPreset[MakeTypedPreset]) Label() (name string)
- func (p *CPreset[MakeTypedPreset]) Make() Preset
- func (p *CPreset[MakeTypedPreset]) OmitTags(features ...Tag) MakeTypedPreset
- func (p *CPreset[MakeTypedPreset]) Overload(tag Tag, feature Feature) MakeTypedPreset
- func (p *CPreset[MakeTypedPreset]) Prepend(features ...Feature) MakeTypedPreset
- func (p *CPreset[MakeTypedPreset]) Preset(b Builder) (err error)
- type CSiteAuthClaims
- func (c *CSiteAuthClaims) GetAllFactors() (factors SiteAuthClaimsFactors)
- func (c *CSiteAuthClaims) GetAudience() (name string)
- func (c *CSiteAuthClaims) GetFactor(kebab, name string) (factor *CSiteAuthClaimsFactor, ok bool)
- func (c *CSiteAuthClaims) GetFactors(kebab string) (factors SiteAuthClaimsFactors)
- func (c *CSiteAuthClaims) GetVerifiedFactor(target string) (factor *CSiteAuthClaimsFactor, ok bool)
- func (c *CSiteAuthClaims) ResetFactorValueTypes()
- func (c *CSiteAuthClaims) RevokeFactor(kebab, name string)
- func (c *CSiteAuthClaims) RevokeFactors(kebab string)
- func (c *CSiteAuthClaims) RevokeVerifiedFactor(target string)
- func (c *CSiteAuthClaims) SetFactor(factor *CSiteAuthClaimsFactor)
- func (c *CSiteAuthClaims) SetVerifiedFactor(target string, factor *CSiteAuthClaimsFactor)
- type CSiteAuthClaimsFactor
- type CSiteAuthMultiFactorInfo
- type CSiteFeatureInfo
- type CanSetupInternals
- type CloudTag
- type CloudTagPage
- type Console
- type ContentSecurityPolicyModifier
- type CspModifierFn
- type DataRestrictionHandler
- type Database
- type EditorFeature
- type EditorMakeFeature
- type EditorOperation
- type EditorOperationFn
- type EditorSite
- type EditorValidateFn
- type EmailProvider
- type EmailSender
- type EnjinBase
- type EnjinBlock
- type EnjinContextProvider
- type EnjinField
- type EnjinInfo
- type EnjinRenderer
- type EnjinRunner
- type EnjinSystem
- type EnjinText
- type EnjinTextFn
- type ExtendedKeyValueStore
- type Feature
- type Features
- type FeaturesCache
- func (c *FeaturesCache) Add(f Feature) (err error)
- func (c *FeaturesCache) Get(tag Tag) (f Feature, ok bool)
- func (c *FeaturesCache) List() (list Features)
- func (c *FeaturesCache) MustGet(tag Tag) (f Feature)
- func (c *FeaturesCache) Prepend(f Feature) (err error)
- func (c *FeaturesCache) Tags() (list Tags)
- type FileProvider
- type FileSystemFeature
- type FinalizeServeRequestFeature
- type FuncMap
- type FuncMapProvider
- type Group
- type Groups
- func (g Groups) Append(groups ...Group) (modified Groups)
- func (g Groups) AppendString(names ...string) (modified Groups)
- func (g Groups) AsNewlines() (newlines string)
- func (g Groups) Has(group Group) (present bool)
- func (g Groups) Len() int
- func (g Groups) Remove(groups ...Group) (modified Groups)
- func (g Groups) String() (s string)
- type GroupsProvider
- type HeadersModifier
- type HotReloadableFeature
- type Internals
- type KeyValueCache
- type KeyValueCacheFeature
- type KeyValueCaches
- type KeyValueStore
- type KeyValueStoreRangeFn
- type KeywordProvider
- type LifeCycleState
- type LocaleHandler
- type LocalesProvider
- type LoggerContext
- type MakeConsole
- type MakeFeature
- type MakePreset
- type MatcherFn
- type MenuProvider
- type MenuSupport
- type MenuSupports
- type MessagePrinterFn
- type MiddlewareFn
- type MountPoints
- type MountedPoints
- func (m MountedPoints) Exists(path string) (present bool)
- func (m MountedPoints) FindPathPoints(path string) (mountPoints MountPoints)
- func (m MountedPoints) FindRWPathPoint(path string) (readWrite *CMountPoint)
- func (m MountedPoints) HasRWFS() (rw bool)
- func (m MountedPoints) HasRootOrAllOf(mounts ...string) (present bool)
- func (m MountedPoints) IsReadOnly(path string) (readOnly bool)
- func (m MountedPoints) ListDirs(path string) (dirs []string)
- func (m MountedPoints) ListFiles(path string) (files []string)
- func (m MountedPoints) ListMounts() (mounts []string)
- func (m MountedPoints) ReadFile(path string) (data []byte, err error)
- func (m MountedPoints) RemoveFile(path string) (err error)
- func (m MountedPoints) WriteFile(path string, data []byte) (err error)
- type NjnClass
- type NjnFeature
- type Nonce
- type NonceFactory
- type NonceFactoryFeature
- type Nonces
- type NotifyHook
- type OutputTransformer
- type OutputTranslator
- type Page
- type PageContextFieldsProvider
- type PageContextFilterFn
- type PageContextModifier
- type PageContextParsersProvider
- type PageContextProvider
- type PageContextUpdater
- type PageFileSystemFeature
- type PageFormat
- type PageFormatProvider
- type PageIndexFeature
- type PageProvider
- type PageRestrictionHandler
- type PageShortcodeProcessor
- type PageStub
- type PageStubs
- type PageTypeProcessor
- type Pages
- type PanicHandler
- type PermissionsPolicyModifier
- type PostStartupFeature
- type PrepareServePagesFeature
- type Preset
- type Processor
- type QueryIndexFeature
- type ReloadableFeature
- type ReqProcessFn
- type RequestFilter
- type RequestFilterFn
- type RequestModifier
- type RequestRewriter
- type RootInternals
- type RoutePagesHandler
- type Runner
- type SearchDocumentMapperFeature
- type SearchEnjinFeature
- type SecretsProvider
- type ServePagesHandler
- type ServePathFeature
- type Service
- type ServiceListener
- type ServiceLogHandler
- type ServiceLogger
- type ServiceResponseLogger
- type Site
- type SiteAuthClaimsFactors
- type SiteAuthFeature
- type SiteAuthProvider
- type SiteAuthRequestHandler
- type SiteAuthSettingsPanel
- type SiteFeature
- type SiteFeatureLabelFn
- type SiteFeatures
- type SiteInfosLookup
- type SiteMakeFeature
- type SiteMultiFactorProvider
- type SiteRootFeature
- type SiteUserRequestModifier
- type SiteUserSetupStage
- type SiteUsersProvider
- type SyncLocker
- type SyncLockerFactory
- type SyncLockerFactoryFeature
- type SyncRWLocker
- type System
- type Tag
- func (t Tag) Camel() string
- func (t Tag) Equal(other Tag) (same bool)
- func (t Tag) IsNil() (empty bool)
- func (t Tag) Kebab() string
- func (t Tag) ScreamingKebab() string
- func (t Tag) ScreamingSnake() string
- func (t Tag) Snake() string
- func (t Tag) Spaced() string
- func (t Tag) SpacedCamel() string
- func (t Tag) String() string
- type TagCloud
- type TagCloudProvider
- type Tags
- type TemplatePartialsProvider
- type Theme
- type ThemeAuthor
- type ThemeConfig
- type ThemeLayout
- type ThemeLayouts
- type ThemeRenderer
- type ThemeSupports
- type TokenFactory
- type TokenFactoryFeature
- type TransformOutputFn
- type TranslateOutputFn
- type TypedFeatures
- func (tf TypedFeatures[T]) AsFeatures() (features Features)
- func (tf TypedFeatures[T]) Find(name string) (tag Tag)
- func (tf TypedFeatures[T]) Get(tag Tag) (found T)
- func (tf TypedFeatures[T]) Has(tag Tag) (present bool)
- func (tf TypedFeatures[T]) Len() (count int)
- func (tf TypedFeatures[T]) Tags() (tags Tags)
- type UpdateSiteRoutesFeature
- type UseMiddleware
- type User
- type UserActionsProvider
- type UserManager
- type UserNotice
- func MakeErrorNotice(dismiss bool, message string, argv ...interface{}) (notice *UserNotice)
- func MakeImportantNotice(dismiss bool, message string, argv ...interface{}) (notice *UserNotice)
- func MakeInfoNotice(dismiss bool, message string, argv ...interface{}) (notice *UserNotice)
- func MakeWarnNotice(dismiss bool, message string, argv ...interface{}) (notice *UserNotice)
- func NewNotice(key string, dismiss bool, summary string, actions ...UserNoticeLink) (notice *UserNotice)
- type UserNoticeLink
- type UserNotices
- type UserProvider
- type ValueStubPair
Constants ¶
const ( PreLockFileSignal signaling.Signal = "pre-lock-file" LockFileSignal signaling.Signal = "lock-file" PreUnlockFileSignal signaling.Signal = "pre-unlock-file" UnlockFileSignal signaling.Signal = "unlock-file" PreMoveFileSignal signaling.Signal = "pre-move-file" MoveFileSignal signaling.Signal = "move-file" PreCopyFileSignal signaling.Signal = "pre-copy-file" CopyFileSignal signaling.Signal = "copy-file" PrePublishFileSignal signaling.Signal = "pre-publish-file" PublishFileSignal signaling.Signal = "publish-file" PreRepublishFileSignal signaling.Signal = "pre-republish-file" RepublishFileSignal signaling.Signal = "republish-file" PreDeleteFileSignal signaling.Signal = "pre-delete-file" DeleteFileSignal signaling.Signal = "delete-file" PreDeletePathSignal signaling.Signal = "pre-delete-path" DeletePathSignal signaling.Signal = "delete-path" PreRetakeFileSignal signaling.Signal = "pre-retake-file" RetakeFileSignal signaling.Signal = "retake-file" PreCommitFileSignal signaling.Signal = "pre-commit-file" CommitFileSignal signaling.Signal = "commit-file" FileNameRequiredSignal signaling.Signal = "file-name-required" PreTranslateFileActionSignal signaling.Signal = "pre-translate-file" TranslateFileActionSignal signaling.Signal = "translate-file" PreChangeActionSignal signaling.Signal = "pre-change-action" ChangeActionSignal signaling.Signal = "change-action" )
const (
UserNoticesRequestKey request.Key = "user-notices"
)
Variables ¶
This section is empty.
Functions ¶
func AddErrorNotice ¶ added in v0.5.0
func AddImportantNotice ¶ added in v0.5.0
func AddInfoNotice ¶ added in v0.5.0
func AddUserNotices ¶ added in v0.5.0
func AddUserNotices(r *http.Request, notes ...*UserNotice) (modified *http.Request)
func AddWarnNotice ¶ added in v0.5.0
func AnyStubsInStubs ¶ added in v0.4.0
func FilterTyped ¶ added in v0.2.15
func FilterTyped[T interface{}](list Features) (found []T)
func FilterUserNotices ¶ added in v0.5.0
func FirstTyped ¶ added in v0.2.15
func FirstTyped[T interface{}](list Features) (found T)
func MakeRawPage ¶ added in v0.5.0
func ParseEditorOpKey ¶ added in v0.5.0
func ParseEditorOpTargetValue ¶ added in v0.5.0
func RegisterPageMatcherFuncs ¶ added in v0.4.0
func RegisterPageMatcherFuncs(matchers ...MatcherFn)
Types ¶
type Action ¶ added in v0.4.0
type Action string
Action is a kebab-cased name consisting of a verb, a subject (feature.Tag) and one or more additional details, separated by periods. For example: the action `view_fs-content_page` has a verb of "view", a subject of "fs-content" and one additional detail of "page". Details are individually converted to kebab-case and joined with periods, ie: `view_fs-content_page.search`
func ParseAction ¶ added in v0.4.0
type Actions ¶ added in v0.4.0
type Actions []Action
Actions are the collection of one or more user Action permissions
func ParseActions ¶ added in v0.4.0
func (Actions) AsNewlines ¶ added in v0.4.0
func (Actions) FilterKnown ¶ added in v0.4.0
func (Actions) FilterUnknown ¶ added in v0.4.0
func (Actions) HasSubject ¶ added in v0.4.0
type ApplyMiddleware ¶ added in v0.1.0
type AuthProvider ¶ added in v0.5.0
type BaseMakePreset ¶ added in v0.4.0
type BaseMakePreset[MakeTypedPreset interface{}] interface { // Include specifies additional features to be included during the build phase Include(features ...Feature) MakeTypedPreset // Prepend includes the specified features before all other features within the preset Prepend(features ...Feature) MakeTypedPreset // OmitTags specifies preset Feature.Tag()s to be omitted during the build phase OmitTags(features ...Tag) MakeTypedPreset // Overload provides a replacement for an existing feature (by tag) // Note: panics if tag specified is not found Overload(tag Tag, feature Feature) MakeTypedPreset }
type Buildable ¶
type Buildable interface { Builder signaling.SignalSupport // MakeEnvKey returns name with EnvPrefix (SCREAMING_SNAKE formatted) MakeEnvKey(name string) (key string) // MakeEnvKeys returns name with EnvPrefix (SCREAMING_SNAKE formatted) MakeEnvKeys(names ...string) (key []string) // RegisterPublicFileSystem mounts the given static FileSystems RegisterPublicFileSystem(mount string, filesystems ...fs.FileSystem) // RegisterTemplatePartial sets the named go-template content for inclusion at the specified block and position // Notes: // * "block" must be one of "head" or "body" // * position must be one of "head" or "tail" // * adds the given name tmpl to the first feature.TemplatePartialsProvider // * auto-adds a feature.TemplatePartialsProvider if none are present RegisterTemplatePartial(block, position, name, tmpl string) (err error) // Features provides access to the cache of enjin features Features() (cache *FeaturesCache) }
type Builder ¶
type Builder interface { // SiteTag is the programmatic tag for identifying this particular enjin SiteTag(key string) Builder // SiteName is the name of the site, typically used in the branding header and browser tab titles SiteName(name string) Builder // SiteTagLine is an optional bit of text to display under the site name in the branding header SiteTagLine(title string) Builder // SiteCopyrightName specifies the first component of a standard copyright declaration for the site SiteCopyrightName(name string) Builder // SiteCopyrightYear specifies the year component of a standard copyright declaration and if left empty, the current // year is used in its place SiteCopyrightYear(year string) Builder // SiteCopyrightNotice specifies the last component of a standard copyright declaration and if left empty, the // phrase "All rights reserved" is used in its place SiteCopyrightNotice(notice string) Builder // SetEnjinTextFn is the means for translating the site name, tag line and copyright components at runtime using a // language printer for every request to the site SetEnjinTextFn(fn EnjinTextFn) Builder SiteLanguageMode(mode lang.Mode) 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 // SetAlwaysHtmlRedirect configures the enjin to always use the HTML meta tag http-equiv=refresh method of // redirecting visitors to another page, the default is to use HTTP status 303 (See other) header redirections // unless explicitly calling the enjin ServeHtmlRedirect method SetAlwaysHtmlRedirect(always bool) Builder // SetHtmlRedirectDelay specifies the number of seconds to delay visitors when performing ServeHtmlRedirect calls, // the default is 0 seconds (immediately on load) SetHtmlRedirectDelay(seconds int) Builder // AddPreset includes the given presets just before the normal enjin Build() phase, presets are added in the same // order given and any features added will be inserted before all other enjin features present AddPreset(presets ...Preset) 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 // 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 appends the given feature within the built Enjin (appends it to the end of the list of features // included) AddFeature(f ...Feature) Builder // PrependFeature prepends the given feature within the built Enjin (inserts it at the start of the list of // features included) PrependFeature(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 // AddModifyContentSecurityPolicyFn includes the given CSP modifier function with each request AddCspModifierFn(tag string, fn CspModifierFn) 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) 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 // SetPublicAccess specifies the list of actions unauthorized visitors have // // Note: not specifying any public access results in no public access given SetPublicAccess(actions ...Action) Builder // AddUserAction adds the given actions to the overall known list of // registered user actions across all features AddUserAction(actions ...Action) Builder // Build constructs an Enjin Runner from the Builder configuration Build() Runner }
type CEnjinBlock ¶
type CEnjinBlock struct {
CNjnFeature
}
type CEnjinField ¶
type CEnjinField struct {
CNjnFeature
}
type CFeature ¶
type CFeature struct { KebabTag string PackageTag Tag FeatureTag Tag Enjin Internals sync.RWMutex // contains filtered or unexported fields }
func (*CFeature) CloneBaseFeature ¶ added in v0.2.5
func (*CFeature) SetState ¶ added in v0.5.6
func (f *CFeature) SetState(state LifeCycleState)
func (*CFeature) State ¶ added in v0.5.6
func (f *CFeature) State() (state LifeCycleState)
func (*CFeature) UsageNotes ¶ added in v0.4.0
type CMountPoint ¶ added in v0.5.0
type CMountPoint struct { // Path is the actual filesystem path Path string // Mount is the URL path prefix Mount string // ROFS is the read-only filesystem, always non-nil ROFS fs.FileSystem // RWFS is the write-only filesystem, nil when fs is read-only RWFS fs.RWFileSystem }
type CNjnFeature ¶ added in v0.5.0
type CNjnFeature struct {
CFeature
}
func (*CNjnFeature) NjnCheckClass ¶ added in v0.5.0
func (f *CNjnFeature) NjnCheckClass(tagClass NjnClass) (allow bool)
func (*CNjnFeature) NjnCheckTag ¶ added in v0.5.0
func (f *CNjnFeature) NjnCheckTag(tagName string) (allow bool)
func (*CNjnFeature) NjnClassAllowed ¶ added in v0.5.0
func (f *CNjnFeature) NjnClassAllowed() (allowed NjnClass, ok bool)
func (*CNjnFeature) NjnTagsAllowed ¶ added in v0.5.0
func (f *CNjnFeature) NjnTagsAllowed() (allowed []string, ok bool)
func (*CNjnFeature) NjnTagsDenied ¶ added in v0.5.0
func (f *CNjnFeature) NjnTagsDenied() (denied []string, ok bool)
type CPreset ¶ added in v0.4.0
type CPreset[MakeTypedPreset interface{}] struct { Name string Features Features // contains filtered or unexported fields }
func (*CPreset[MakeTypedPreset]) IncludeFeature ¶ added in v0.4.0
IncludeFeature will prepend the given feature to the Builder enjin, taking into account omissions and overloads
func (*CPreset[MakeTypedPreset]) Init ¶ added in v0.4.0
func (p *CPreset[MakeTypedPreset]) Init(this interface{})
type CSiteAuthClaims ¶ added in v0.5.0
type CSiteAuthClaims struct { // RID is the Real ID of the user RID string // EID is the Enjin ID of the user EID string // Email is the email address of the user Email string // Context is the variable metadata related to the user Context beContext.Context jwt.RegisteredClaims }
func (*CSiteAuthClaims) GetAllFactors ¶ added in v0.5.0
func (c *CSiteAuthClaims) GetAllFactors() (factors SiteAuthClaimsFactors)
func (*CSiteAuthClaims) GetAudience ¶ added in v0.5.0
func (c *CSiteAuthClaims) GetAudience() (name string)
GetAudience returns the first name in the .Audience ClaimStrings list
func (*CSiteAuthClaims) GetFactor ¶ added in v0.5.0
func (c *CSiteAuthClaims) GetFactor(kebab, name string) (factor *CSiteAuthClaimsFactor, ok bool)
func (*CSiteAuthClaims) GetFactors ¶ added in v0.5.0
func (c *CSiteAuthClaims) GetFactors(kebab string) (factors SiteAuthClaimsFactors)
func (*CSiteAuthClaims) GetVerifiedFactor ¶ added in v0.5.0
func (c *CSiteAuthClaims) GetVerifiedFactor(target string) (factor *CSiteAuthClaimsFactor, ok bool)
func (*CSiteAuthClaims) ResetFactorValueTypes ¶ added in v0.5.0
func (c *CSiteAuthClaims) ResetFactorValueTypes()
ResetFactorValueTypes will check all factors and verifications for factors-as-maps and convert them to their proper concrete types
func (*CSiteAuthClaims) RevokeFactor ¶ added in v0.5.0
func (c *CSiteAuthClaims) RevokeFactor(kebab, name string)
func (*CSiteAuthClaims) RevokeFactors ¶ added in v0.5.0
func (c *CSiteAuthClaims) RevokeFactors(kebab string)
func (*CSiteAuthClaims) RevokeVerifiedFactor ¶ added in v0.5.0
func (c *CSiteAuthClaims) RevokeVerifiedFactor(target string)
func (*CSiteAuthClaims) SetFactor ¶ added in v0.5.0
func (c *CSiteAuthClaims) SetFactor(factor *CSiteAuthClaimsFactor)
func (*CSiteAuthClaims) SetVerifiedFactor ¶ added in v0.5.0
func (c *CSiteAuthClaims) SetVerifiedFactor(target string, factor *CSiteAuthClaimsFactor)
type CSiteAuthClaimsFactor ¶ added in v0.5.0
type CSiteAuthClaimsFactor struct { // K is a kebab-cased feature.Tag K string `json:"k"` // N is a user-provided label for this factor N string `json:"n"` // E is an expiration unix epoch E int64 `json:"e"` // T is a timestamp unix epoch T int64 `json:"t"` // C is the challenge provided by the user C string `json:"c"` }
func NewSiteAuthClaimsFactor ¶ added in v0.5.0
func NewSiteAuthClaimsFactor(k, n string, e, t int64, c string) (p *CSiteAuthClaimsFactor)
func ParseSiteAuthClaimsFactor ¶ added in v0.5.0
func ParseSiteAuthClaimsFactor(m map[string]interface{}) (p *CSiteAuthClaimsFactor, ok bool)
func (CSiteAuthClaimsFactor) ToMap ¶ added in v0.5.0
func (p CSiteAuthClaimsFactor) ToMap() (m map[string]interface{})
type CSiteAuthMultiFactorInfo ¶ added in v0.5.0
type CSiteAuthMultiFactorInfo struct { CSiteFeatureInfo // Ready is true when the current user has at least one provisioned factor of this type Ready bool `json:"ready"` // Factors is the list of provisioned factors, of this type, ready for challenging the current user Factors []string `json:"factors"` // Claimed is the list of provisioned factors which are present in the current user's claims Claimed []string `json:"claimed"` // Submit indicates whether to submit the feature.Tag in order to initiate the challenge process Submit bool `json:"submit"` }
func NewSiteAuthMultiFactorInfo ¶ added in v0.5.0
func NewSiteAuthMultiFactorInfo(tag, key, icon, label string, factors ...string) (info *CSiteAuthMultiFactorInfo)
type CSiteFeatureInfo ¶ added in v0.5.0
type CSiteFeatureInfo struct { // Tag is the kebab-cased feature.Tag Tag string `json:"tag"` // Key is a different kebab-cased tag than Tag Key string `json:"key"` // Icon is a font-awesome icon class Icon string `json:"icon"` // Label is a translated string label Label string `json:"label"` // Usage is a sentence or two describing how to use this feature Usage string `json:"usage"` // Hint is used in multiple-step authentications, typically as a button's title attribute Hint string `json:"hint"` // Placeholder is the string of text displayed in the challenge form input tag Placeholder string `json:"placeholder"` // Backup indicates whether this feature is a backup feature or not Backup bool `json:"backup"` }
func NewSiteFeatureInfo ¶ added in v0.5.0
func NewSiteFeatureInfo(tag, key, icon, label string) (info *CSiteFeatureInfo)
type CanSetupInternals ¶
type CanSetupInternals interface {
Setup(enjin Internals)
}
type CloudTagPage ¶ added in v0.5.11
type CspModifierFn ¶ added in v0.5.1
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 EditorFeature ¶ added in v0.5.0
type EditorFeature interface { SiteFeature signaling.Signaling UserActionsProvider SelfEditor() (self EditorFeature) SetupEditor(editor EditorSite) SetupEditorRoute(r chi.Router) EditorMenu(r *http.Request) (m menu.Menu) GetEditorKey() (name string) GetEditorPath() (path string) GetEditorMenu() (m menu.Menu) PrepareEditPage(pageType, editorType string, r *http.Request) (pg Page, ctx beContext.Context, err error) ParseEditorUrlParams(r *http.Request) (fsid, code, file string, locale *language.Tag) ServePreparedEditPage(pg Page, ctx beContext.Context, w http.ResponseWriter, r *http.Request) UpdatePathInfo(info *editor.File, r *http.Request) UpdateFileInfo(info *editor.File, r *http.Request) UpdateFileInfoForEditing(info *editor.File, r *http.Request) PrepareEditableFile(r *http.Request, info *editor.File) (editFile *editor.File) ListFileSystems() (list editor.Files) ListFileSystemLocales(fsid string) (list editor.Files) ListFileSystemDirectories(r *http.Request, fsid, code, dirs string) (list editor.Files) ListFileSystemFiles(r *http.Request, fsid, code, dirs string) (list editor.Files) ProcessMountPointFile(r *http.Request, printer *message.Printer, eid, mpfBTag, mpfTag, code, dirs, file string, mountPoint *CMountPoint, draftWork bool) (ef *editor.File, ignored bool) LockEditorFile(eid, fsid, filePath string) (err error) IsEditorFileLocked(fsid, filePath string) (eid string, locked bool) UnLockEditorFile(fsid, filePath string) (err error) FileExists(info *editor.File) (exists bool) ReadFile(info *editor.File) (data []byte, err error) WriteFile(info *editor.File, data []byte) (err error) RemoveFile(info *editor.File) (err error) RemoveDirectory(info *editor.File) (err error) DraftExists(info *editor.File) (present bool) ReadDraft(info *editor.File) (contents []byte, err error) ReadDraftMatter(info *editor.File) (pm *matter.PageMatter, err error) WriteDraft(info *editor.File, contents []byte) (err error) RemoveDraft(info *editor.File) (err error) PublishDraft(info *editor.File) (err error) RenderFileBrowser(w http.ResponseWriter, r *http.Request) RenderFileEditor(w http.ResponseWriter, r *http.Request) ReceiveFileEditorChanges(w http.ResponseWriter, r *http.Request) OpFileUnlockHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) OpFileRetakeHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) OpFileDeleteValidate(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (err error) OpFileDeleteHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) OpFileCommitValidate(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (err error) OpFileCommitHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) OpFilePublishValidate(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (err error) OpFilePublishHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) OpFileCancelValidate(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (err error) OpFileCancelHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) OpFileMoveValidate(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (err error) OpFileMoveHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) OpFileCopyValidate(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (err error) OpFileCopyHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) OpFileTranslateValidate(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (err error) OpFileTranslateHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) OpPathDeleteValidate(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (err error) OpPathDeleteHandler(r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string) (redirect string) }
type EditorMakeFeature ¶ added in v0.5.0
type EditorMakeFeature[MakeTypedFeature interface{}] interface { SiteMakeFeature[MakeTypedFeature] SetEditorName(name string) MakeTypedFeature SetEditorType(editorType string) MakeTypedFeature SetEditingTags(tags ...Tag) MakeTypedFeature }
type EditorOperation ¶ added in v0.5.0
type EditorOperation struct { // Key is the submit button kebab-cased value Key string `json:"key"` // Confirm is the confirmation form parameter, leave empty for no confirmation step Confirm string `json:"confirm,omitempty"` // Action is the permission users are required to have in order to perform the operation Action Action // Validate is the handler called to sanitize the form ctx Validate EditorValidateFn // Operation is the handler called to perform the operation Operation EditorOperationFn }
type EditorOperationFn ¶ added in v0.5.0
type EditorSite ¶ added in v0.5.0
type EditorSite interface { SiteFeature ListPageTypes() (values []string) ListPageLayouts() (names []string) }
type EditorValidateFn ¶ added in v0.5.0
type EmailProvider ¶ added in v0.1.0
type EmailProvider interface { Feature NewEmail(path string, bodyCtx beContext.Context) (message *gomail.Message, err error) MakeEmailBody(path string, ctx beContext.Context) (matter beContext.Context, body string, err error) ListTemplates() (names []string) HasTemplate(name string) (present bool) }
type EmailSender ¶ added in v0.1.0
type EnjinBase ¶ added in v0.5.0
type EnjinBase interface { SiteTag() (key string) SiteName() (name string) SiteTagLine() (tagLine string) SiteCopyrightName() (name string) SiteCopyrightYear() (year string) SiteCopyrightNotice() (notice string) SiteLocales() (locales cllang.Tags) SiteLanguageMode() (mode lang.Mode) SiteLanguageCatalog() (c catalog.Catalog) SiteDefaultLanguage() (tag language.Tag) SiteSupportsLanguage(tag language.Tag) (supported bool) SiteLanguageDisplayName(tag language.Tag) (name string, ok bool) FindTranslations(url string) (pages Pages) FindTranslationUrls(url string) (pages map[language.Tag]string) FindPage(r *http.Request, tag language.Tag, url string) (p Page) FindPages(prefix string) (pages []Page) }
type EnjinBlock ¶
type EnjinBlock interface { NjnFeature 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 EnjinContextProvider ¶ added in v0.4.0
type EnjinField ¶
type EnjinField interface { NjnFeature NjnFieldNames() (tagNames []string) PrepareNjnData(re EnjinRenderer, tagName string, field map[string]interface{}) (data map[string]interface{}, err error) }
type EnjinInfo ¶ added in v0.5.0
type EnjinInfo struct { Tag string EnjinText Locales []language.Tag LangMode lang.Mode DefaultLang language.Tag }
func MakeEnjinInfo ¶ added in v0.5.0
type EnjinRenderer ¶
type EnjinRenderer interface { RequestArgv() (reqArgv *argv.Argv) 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 EnjinTextFn ¶ added in v0.5.1
type ExtendedKeyValueStore ¶ added in v0.5.6
type ExtendedKeyValueStore interface { KeyValueStore Size() (count int) Keys(prefix string) (keys []string) Range(prefix string, fn KeyValueStoreRangeFn) StreamKeys(prefix string, ctx context.Context) (keys chan string) }
type Feature ¶
type Feature interface { // Construct is used as the last call within the standard NewTagged(tag) constructor and is used by extended types // to perform initializations which require the .FeatureTag set Construct(this interface{}) // Init is used as the first call within the standard NewTagged(tag) constructor to perform initializations which // do not require the .FeatureTag set Init(this interface{}) // Tag is the feature.Tag for this particular feature instance Tag() (tag Tag) // BaseTag is the stock tag common to all feature instances of this type BaseTag() (pkg Tag) // This returns an interface{} reference to the underlying structure instance This() (this interface{}) // Self returns f.this, typed as a Feature, in such a way that calling f.Self().Thing() from a base type will invoke // the type's overloaded method; for example: // - feature A implements `.Thing()` method and calls `f.Thing()` from some `.OtherThing()` method // - feature B embeds feature A and overloads the `.Thing()` method // - when feature A calls `f.Thing()` within `.OtherThing()`, feature A's method is invoked // - if feature A instead calls `f.Self().Thing()` instead, feature B's method is invoked // // The example above is of course contrived as this only works with Feature methods, however, the design pattern can // be re-used in other systems to achieve the same effect, see EditorFeature.SelfEditor for another example. Self() (f Feature) State() (state LifeCycleState) Depends() (deps Tags) UsageNotes() (notes []string) Build(c Buildable) (err error) Setup(enjin Internals) Startup(ctx *cli.Context) (err error) Shutdown() }
type FeaturesCache ¶ added in v0.2.15
type FeaturesCache struct {
// contains filtered or unexported fields
}
func NewFeaturesCache ¶ added in v0.2.15
func NewFeaturesCache() (cache *FeaturesCache)
func (*FeaturesCache) Add ¶ added in v0.2.15
func (c *FeaturesCache) Add(f Feature) (err error)
func (*FeaturesCache) Get ¶ added in v0.2.15
func (c *FeaturesCache) Get(tag Tag) (f Feature, ok bool)
func (*FeaturesCache) List ¶ added in v0.2.15
func (c *FeaturesCache) List() (list Features)
func (*FeaturesCache) MustGet ¶ added in v0.2.15
func (c *FeaturesCache) MustGet(tag Tag) (f Feature)
func (*FeaturesCache) Prepend ¶ added in v0.4.0
func (c *FeaturesCache) Prepend(f Feature) (err error)
func (*FeaturesCache) Tags ¶ added in v0.2.15
func (c *FeaturesCache) Tags() (list Tags)
type FileProvider ¶ added in v0.1.0
type FileSystemFeature ¶ added in v0.5.0
type FileSystemFeature interface { Feature IsLocalized() (supported bool) MountPathROFS(path string, point string, rofs fs.FileSystem) MountPathRWFS(path string, point string, rwfs fs.RWFileSystem) FindPathMountPoint(path string) (mps MountPoints) Exists(path string) (present bool) FindPageMatterPath(prefix string) (path string, err error) FindReadPageMatter(path string) (pm *matter.PageMatter, err error) ReadPageMatter(path string) (pm *matter.PageMatter, err error) WritePageMatter(pm *matter.PageMatter) (err error) GetMountedPoints() (mountPoints MountedPoints) }
type FinalizeServeRequestFeature ¶ added in v0.5.0
type FuncMap ¶ added in v0.4.0
type FuncMap textTemplate.FuncMap
func (FuncMap) AsHTML ¶ added in v0.4.0
func (fm FuncMap) AsHTML() htmlTemplate.FuncMap
func (FuncMap) AsTEXT ¶ added in v0.4.0
func (fm FuncMap) AsTEXT() textTemplate.FuncMap
type FuncMapProvider ¶ added in v0.4.0
type Groups ¶ added in v0.5.0
type Groups []Group
Groups are the collection of one or more groups
func NewGroupsFromStringNL ¶ added in v0.5.0
func NewGroupsFromStrings ¶ added in v0.5.0
func (Groups) AppendString ¶ added in v0.5.0
func (Groups) AsNewlines ¶ added in v0.5.0
type GroupsProvider ¶ added in v0.5.0
type HeadersModifier ¶
type HeadersModifier interface { Feature ModifyHeaders(w http.ResponseWriter, r *http.Request) }
type HotReloadableFeature ¶ added in v0.5.0
type Internals ¶
type Internals interface { Service signaling.Signaling EnjinBase Self() (self interface{}) Features() (cache *FeaturesCache) Pages() (pages map[string]Page) Theme() (theme string) Theming() (theming map[string]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) ReloadLocales() HotReloading() (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{}) MakeFuncMap(ctx context.Context) (fm FuncMap) PublicFileSystems() (registry fs.Registry) ListTemplatePartials(block, position string) (names []string) GetTemplatePartial(block, position, name string) (tmpl string, ok bool) MakeLanguagePrinter(requested string) (tag language.Tag, printer *message.Printer) PublicUserActions() (actions Actions) ValidateUserRequest(action Action, w http.ResponseWriter, r *http.Request) (valid bool) PageContextParsers() (parsers context.Parsers) MakePageContextField(key string, r *http.Request) (field *context.Field, ok bool) MakePageContextFields(r *http.Request) (fields context.Fields) ApplyPageContextUpdaters(r *http.Request, pages ...Page) GetFormatProviders() []PageFormatProvider GetRequestFilters() []RequestFilter GetPageContextModifiers() []PageContextModifier GetPageContextUpdaters() []PageContextUpdater GetPageRestrictionHandlers() []PageRestrictionHandler GetMenuProviders() []MenuProvider GetDataRestrictionHandlers() []DataRestrictionHandler GetOutputTranslators() []OutputTranslator GetOutputTransformers() []OutputTransformer GetPageTypeProcessors() []PageTypeProcessor GetServePathFeatures() []ServePathFeature GetDatabases() []Database GetEmailSenders() []EmailSender GetRequestModifiers() []RequestModifier GetRequestRewriters() []RequestRewriter GetPermissionsPolicyModifiers() []PermissionsPolicyModifier GetContentSecurityPolicyModifiers() []ContentSecurityPolicyModifier GetUseMiddlewares() []UseMiddleware GetHeadersModifiers() []HeadersModifier GetProcessors() []Processor GetApplyMiddlewares() []ApplyMiddleware GetPageProviders() []PageProvider GetFileProviders() []FileProvider GetQueryIndexFeatures() []QueryIndexFeature GetPageContextProviders() []PageContextProvider GetAuthProviders() []AuthProvider GetUserActionsProviders() []UserActionsProvider GetEnjinContextProvider() []EnjinContextProvider GetPageShortcodeProcessors() []PageShortcodeProcessor GetFuncMapProviders() []FuncMapProvider GetTemplatePartialsProvider() []TemplatePartialsProvider GetThemeRenderers() []ThemeRenderer GetServiceLoggers() []ServiceLogger GetLocalesProviders() []LocalesProvider GetPrepareServePagesFeatures() []PrepareServePagesFeature GetFinalizeServePagesFeatures() []FinalizeServeRequestFeature GetPageContextFieldsProviders() []PageContextFieldsProvider GetPageContextParsersProviders() []PageContextParsersProvider GetPanicHandler() PanicHandler GetLocaleHandler() LocaleHandler GetServiceListener() ServiceListener GetRoutePagesHandler() RoutePagesHandler GetServePagesHandler() ServePagesHandler GetServiceLogHandler() ServiceLogHandler }
type KeyValueCache ¶ added in v0.5.0
type KeyValueCache interface { // ListBuckets returns the names of all buckets ListBuckets() (names []string) // Bucket returns the named bucket or adds a new bucket and returns that Bucket(name string) (kvs KeyValueStore, err error) // MustBucket uses Bucket and on error will log.ErrorDF and panic MustBucket(name string) (kvs KeyValueStore) // AddBucket adds and returns a new bucket, errors if already exists AddBucket(name string) (kvs KeyValueStore, err error) // GetBucket returns a new bucket, errors if not found GetBucket(name string) (kvs KeyValueStore, err error) // GetBucketSource returns the underlying cache object, or nil if not found GetBucketSource(name string) (src interface{}) }
type KeyValueCacheFeature ¶ added in v0.5.6
type KeyValueCaches ¶ added in v0.5.0
type KeyValueCaches interface { Feature Get(name string) (kvs KeyValueCache, err error) }
type KeyValueStore ¶ added in v0.5.0
type KeyValueStoreRangeFn ¶ added in v0.5.6
type KeywordProvider ¶ added in v0.4.0
type LifeCycleState ¶ added in v0.5.6
type LifeCycleState uint8
const ( StateCreated LifeCycleState = iota StateConstructed StateInitialized StateMade StateBuilt StateSetup StateStarted StatePostStarted StateShutdown EndLifeCycleStates )
func (LifeCycleState) String ¶ added in v0.5.6
func (l LifeCycleState) String() (name string)
func (LifeCycleState) Valid ¶ added in v0.5.6
func (l LifeCycleState) Valid() (valid bool)
type LocaleHandler ¶ added in v0.5.0
type LocalesProvider ¶ added in v0.5.0
type LoggerContext ¶ added in v0.4.0
type LoggerContext interface { // URL is the parsed request URL URL() (parsed *url.URL) // Size is the number of response bytes Size() (size int) // StatusCode is the HTTP status code of the response StatusCode() (status int) // TimeStamp returns when the request was first received TimeStamp() (when time.Time) // Duration returns the total time taken to complete the request Duration() (duration time.Duration) // Request returns the request object Request() (r *http.Request) }
LoggerContext is a per-request context used with ServiceLogger implementations
type MakeConsole ¶
type MakeConsole interface {
Make() Console
}
type MakeFeature ¶
type MakeFeature interface {
Make() Feature
}
type MakePreset ¶ added in v0.4.0
type MakePreset interface { Make() Preset BaseMakePreset[MakePreset] }
func NewPresetWith ¶ added in v0.4.0
func NewPresetWith(name string, features ...Feature) MakePreset
type MatcherFn ¶ added in v0.4.0
func GetPageMatcherFuncs ¶ added in v0.4.0
func GetPageMatcherFuncs() (funcs []MatcherFn)
type MenuProvider ¶
type MenuSupport ¶ added in v0.5.0
type MenuSupports ¶ added in v0.5.0
type MenuSupports []MenuSupport
func ParseMenuSupports ¶ added in v0.5.0
func ParseMenuSupports(input interface{}) (supports MenuSupports)
func (MenuSupports) Append ¶ added in v0.5.0
func (m MenuSupports) Append(others MenuSupports) (merged MenuSupports)
func (MenuSupports) Has ¶ added in v0.5.0
func (m MenuSupports) Has(key string) (supported bool)
func (MenuSupports) Keys ¶ added in v0.5.0
func (m MenuSupports) Keys() (keys []string)
type MessagePrinterFn ¶ added in v0.5.0
type MountPoints ¶ added in v0.5.0
type MountPoints []*CMountPoint
func (MountPoints) Append ¶ added in v0.5.0
func (m MountPoints) Append(mountPoint *CMountPoint) (modified MountPoints)
func (MountPoints) HasRWFS ¶ added in v0.5.0
func (m MountPoints) HasRWFS() (rw bool)
func (MountPoints) Len ¶ added in v0.5.0
func (m MountPoints) Len() (count int)
type MountedPoints ¶ added in v0.5.0
type MountedPoints map[string]MountPoints
func (MountedPoints) Exists ¶ added in v0.5.0
func (m MountedPoints) Exists(path string) (present bool)
func (MountedPoints) FindPathPoints ¶ added in v0.5.0
func (m MountedPoints) FindPathPoints(path string) (mountPoints MountPoints)
FindPathPoints returns a list of MountPoints which prefix match the given path
func (MountedPoints) FindRWPathPoint ¶ added in v0.5.0
func (m MountedPoints) FindRWPathPoint(path string) (readWrite *CMountPoint)
FindRWPathPoint finds the first read-write MountPoint matching the path given
func (MountedPoints) HasRWFS ¶ added in v0.5.0
func (m MountedPoints) HasRWFS() (rw bool)
func (MountedPoints) HasRootOrAllOf ¶ added in v0.5.0
func (m MountedPoints) HasRootOrAllOf(mounts ...string) (present bool)
func (MountedPoints) IsReadOnly ¶ added in v0.5.0
func (m MountedPoints) IsReadOnly(path string) (readOnly bool)
func (MountedPoints) ListDirs ¶ added in v0.5.0
func (m MountedPoints) ListDirs(path string) (dirs []string)
func (MountedPoints) ListFiles ¶ added in v0.5.0
func (m MountedPoints) ListFiles(path string) (files []string)
func (MountedPoints) ListMounts ¶ added in v0.5.0
func (m MountedPoints) ListMounts() (mounts []string)
func (MountedPoints) ReadFile ¶ added in v0.5.0
func (m MountedPoints) ReadFile(path string) (data []byte, err error)
func (MountedPoints) RemoveFile ¶ added in v0.5.0
func (m MountedPoints) RemoveFile(path string) (err error)
type NjnFeature ¶ added in v0.5.0
type Nonce ¶ added in v0.5.0
type Nonce struct { // Key is the string to use with nonce factories Key string `json:"key"` // Name is the form hidden input name Name string `json:"name"` // Value is the actual nonce to be used with this key/name combination; Value may be omitted in which case the theme // must call `Nonce $nonce.Key` to get the correct nonce value to use Value string `json:"-"` }
type NonceFactory ¶ added in v0.5.0
type NonceFactoryFeature ¶ added in v0.5.0
type NonceFactoryFeature interface { Feature NonceFactory }
type NotifyHook ¶
type NotifyHook = func(format string, argv ...interface{})
type OutputTransformer ¶
type OutputTranslator ¶
type Page ¶ added in v0.4.0
type Page interface { Type() (pageType string) Format() (pageFormat string) Url() (url string) Slug() (slug string) Path() (path string) Title() (title string) Description() (description string) Layout() (layoutName string) Section() (section string) Archetype() (archetype string) Permalink() (id uuid.UUID) PermalinkSha() (shasum string) Language() (code string) LanguageTag() (tag language.Tag) Translates() (url string) Shasum() (shasum string) Content() (content string) FrontMatter() (frontMatter string) FrontMatterType() (frontMatterType matter.FrontMatterType) PageMatter() (pageMatter *matter.PageMatter) CreatedAt() (at time.Time) UpdatedAt() (at time.Time) DeletedAt() (at sql.NullTime) Context() (ctx beContext.Context) String() (jsonPage string) Match(path string) (found string, ok bool) MatchQL(query string) (ok bool, err error) MatchPrefix(prefix string) (found string, ok bool) Redirections() (redirects []string) IsRedirection(path string) (ok bool) IsTranslation(path string) (ok bool) HasTranslation() (ok bool) SetType(pageType string) SetFormat(pageFormat string) (path string) SetSlugUrl(url string) SetTitle(title string) SetDescription(description string) SetLayout(layoutName string) SetArchetype(archetype string) SetPermalink(value string) (err error) SetLanguage(tag language.Tag) SetTranslates(url string) SetContent(content string) SetFrontMatter(frontMatter string) SetFrontMatterType(frontMatterType matter.FrontMatterType) SetCreatedAt(at time.Time) SetUpdatedAt(at time.Time) SetDeletedAt(at sql.NullTime) Copy() (copy Page) }
func ParseSignalArgv ¶ added in v0.5.0
func ParseSignalArgv(argv []interface{}) (r *http.Request, pg Page, ctx, form beContext.Context, info *editor.File, eid string, redirect *string, ok bool)
ParseSignalArgv is a helper function for translating the emitted signal argv into concrete types
`r, pg, ctx, form, info, eid, file, redirect, ok := bePkgEditor.ParseSignalArgv(argv)`
type PageContextFieldsProvider ¶ added in v0.5.0
type PageContextFilterFn ¶
type PageContextModifier ¶
type PageContextParsersProvider ¶ added in v0.5.0
type PageContextProvider ¶ added in v0.4.0
type PageContextProvider interface { Feature FindPageStub(shasum string) (stub *PageStub) PageContextValuesCount(key string) (count uint64) PageContextValueCounts(key string) (counts map[interface{}]uint64) YieldPageContextValueStubs(key string) (pairs chan *ValueStubPair) YieldFilterPageContextValueStubs(include bool, key string, value interface{}) (pairs chan *ValueStubPair) FilterPageContextValueStubs(include bool, key string, value interface{}) (stubs PageStubs) }
type PageContextUpdater ¶ added in v0.5.0
type PageFileSystemFeature ¶ added in v0.5.0
type PageFileSystemFeature interface { FileSystemFeature AddIndexing(filePath string) RemoveIndexing(filePath string) }
type PageFormat ¶ added in v0.4.0
type PageFormat interface { Feature Name() (name string) Label() (label string) Extensions() (extensions []string) Prepare(ctx context.Context, content string) (out context.Context, err error) Process(ctx context.Context, content string) (html template.HTML, redirect string, err error) IndexDocument(pg Page) (doc interface{}, err error) NewDocumentMapping(tag language.Tag) (doctype, analyzer string, dm *mapping.DocumentMapping) }
type PageFormatProvider ¶ added in v0.4.0
type PageFormatProvider interface { ListFormats() (names []string) GetFormat(name string) (format PageFormat) MatchFormat(filename string) (format PageFormat, match string) }
type PageIndexFeature ¶ added in v0.4.0
type PageProvider ¶
type PageRestrictionHandler ¶
type PageShortcodeProcessor ¶ added in v0.4.0
type PageStub ¶ added in v0.4.0
type PageStub struct { Origin string `json:"origin"` FS fs.FileSystem `json:"fs"` Point string `json:"point"` Shasum string `json:"shasum"` Source string `json:"source"` Language language.Tag `json:"language"` Fallback language.Tag `json:"fallback"` EnjinCtx beContext.Context `json:"enjin-ctx"` }
func NewPageStub ¶ added in v0.4.0
func (*PageStub) MarshalBinary ¶ added in v0.4.0
func (*PageStub) UnmarshalBinary ¶ added in v0.4.0
type PageStubs ¶ added in v0.4.0
type PageStubs []*PageStub
type PageTypeProcessor ¶
type PanicHandler ¶ added in v0.5.0
type PermissionsPolicyModifier ¶
type PermissionsPolicyModifier interface { Feature ModifyPermissionsPolicy(policy permissions.Policy, r *http.Request) (modified permissions.Policy) }
type PostStartupFeature ¶ added in v0.5.0
type PrepareServePagesFeature ¶ added in v0.5.0
type QueryIndexFeature ¶ added in v0.4.0
type ReloadableFeature ¶ added in v0.5.6
type ReloadableFeature interface {
Reload()
}
type ReqProcessFn ¶
type RequestFilter ¶
type RequestFilterFn ¶
type RequestModifier ¶
type RequestModifier interface { Feature ModifyRequest(w http.ResponseWriter, r *http.Request) }
type RequestRewriter ¶
type RootInternals ¶
type RoutePagesHandler ¶ added in v0.4.0
type RoutePagesHandler interface { Feature RoutePage(w http.ResponseWriter, r *http.Request) }
type SearchDocumentMapperFeature ¶ added in v0.4.0
type SearchDocumentMapperFeature interface { Feature SearchDocumentMapping(tag language.Tag) (doctype string, dm *mapping.DocumentMapping) AddSearchDocumentMapping(tag language.Tag, indexMapping *mapping.IndexMappingImpl) }
type SearchEnjinFeature ¶ added in v0.4.0
type SearchEnjinFeature interface { Feature PrepareSearch(tag language.Tag, input string) (query string) PerformSearch(tag language.Tag, input string, size, pg int) (results *bleve.SearchResult, err error) AddToSearchIndex(stub *PageStub, p Page) (err error) RemoveFromSearchIndex(stub *PageStub, p Page) }
type SecretsProvider ¶ added in v0.5.0
type ServePagesHandler ¶ added in v0.5.0
type ServePathFeature ¶ added in v0.1.0
type Service ¶
type Service interface { Prefix() (prefix string) Context(r *http.Request) (ctx context.Context) GetTheme() (t Theme, err error) MustGetTheme() (t Theme) ThemeNames() (names []string) GetThemeName() (name string) GetThemeNamed(name string) (t Theme, err error) MustGetThemeNamed(name string) (t Theme) ServerName() (name string) ServiceInfo() (scheme, listen string, port int) PermissionsPolicy() (handler *permissions.PolicyHandler) ContentSecurityPolicy() (handler *csp.PolicyHandler) FinalizeServeRequest(w http.ResponseWriter, r *http.Request) (modified *http.Request) ServeRedirect(destination string, w http.ResponseWriter, r *http.Request) ServeRedirectHomePath(w http.ResponseWriter, r *http.Request) Serve204(w http.ResponseWriter, r *http.Request) Serve400(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) ServeForbidden(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, w http.ResponseWriter, r *http.Request) (err error) ServePath(urlPath string, w http.ResponseWriter, r *http.Request) (err error) ServeJSON(v interface{}, w http.ResponseWriter, r *http.Request) (err error) ServeStatusJSON(status int, v interface{}, w http.ResponseWriter, r *http.Request) (err error) ServeData(data []byte, mime string, w http.ResponseWriter, r *http.Request) MatchQL(query string) (pages []Page) MatchStubsQL(query string) (stubs []*PageStub) SelectQL(query string) (selected map[string]interface{}) CheckMatchQL(query string) (pages []Page, err error) CheckMatchStubsQL(query string) (stubs []*PageStub, err error) CheckSelectQL(query string) (selected map[string]interface{}, err error) FindPageStub(shasum string) (stub *PageStub) FindPage(r *http.Request, tag language.Tag, url string) (p Page) FindFile(path string) (data []byte, mime string, err error) FindEmailAccount(account string) (emailSender EmailSender) SendEmail(r *http.Request, account string, message *gomail.Message) (err error) GetPublicAccess() (actions Actions) FindAllUserActions() (list Actions) NonceFactory TokenFactory SyncLockerFactory Notify(tag string) NotifyF(tag, format string, argv ...interface{}) TranslateShortcodes(content string, ctx context.Context) (modified string) GetThemeRenderer(ctx context.Context) (renderer ThemeRenderer) signaling.EmitterSupport }
type ServiceListener ¶ added in v0.4.0
type ServiceLogHandler ¶ added in v0.4.0
type ServiceLogger ¶ added in v0.4.0
type ServiceLogger interface { Feature RequestLogger(ctx LoggerContext) (err error) }
type ServiceResponseLogger ¶ added in v0.4.0
type Site ¶ added in v0.5.0
type Site interface { Feature signaling.Signaling SitePath() (path string) SiteMenu(r *http.Request) (siteMenu beContext.Context) SiteTheme() (t Theme) SiteUsers() (sup SiteUsersProvider) SiteAuth() (sup SiteAuthFeature) SiteFeatures() (list SiteFeatures) PushImportantNotice(eid string, dismiss bool, message string, argv ...interface{}) PushInfoNotice(eid string, dismiss bool, message string, argv ...interface{}) PushWarnNotice(eid string, dismiss bool, message string, argv ...interface{}) PushErrorNotice(eid string, dismiss bool, message string, argv ...interface{}) PushNotices(eid string, notices ...*UserNotice) PullNotices(eid string) (notices UserNotices) GetContext(eid string) (ctx beContext.Context) SetContext(eid string, ctx beContext.Context) ApplyContext(eid string, changes beContext.Context) DeleteContextKeys(eid string, keys ...string) PreparePage(layout, pageType, pagePath string, t Theme, r *http.Request) (pg Page, ctx beContext.Context, err error) ServePreparedPage(pg Page, ctx beContext.Context, t Theme, w http.ResponseWriter, r *http.Request) PrepareAndServePage(layout, pageType, pagePath string, t Theme, w http.ResponseWriter, r *http.Request, ctx beContext.Context) (err error) RequireVerification(path string, w http.ResponseWriter, r *http.Request) (allowed bool) MustRequireVerification(path string, w http.ResponseWriter, r *http.Request) (allowed bool) }
type SiteAuthClaimsFactors ¶ added in v0.5.0
type SiteAuthClaimsFactors []*CSiteAuthClaimsFactor
func ParseSiteAuthClaimsFactors ¶ added in v0.5.0
func ParseSiteAuthClaimsFactors(v interface{}) (p SiteAuthClaimsFactors, ok bool)
func (SiteAuthClaimsFactors) Filter ¶ added in v0.5.0
func (f SiteAuthClaimsFactors) Filter(provision string) (modified SiteAuthClaimsFactors)
Filter returns the same list of factors, without the provision given
func (SiteAuthClaimsFactors) Find ¶ added in v0.5.0
func (f SiteAuthClaimsFactors) Find(provision string) (found *CSiteAuthClaimsFactor, ok bool)
Find returns the first factor that matches the "kebab;name" provision string given
func (SiteAuthClaimsFactors) Len ¶ added in v0.5.0
func (f SiteAuthClaimsFactors) Len() (count int)
type SiteAuthFeature ¶ added in v0.5.0
type SiteAuthFeature interface { Feature Site() Site SiteFeatureKey() (name string) SiteFeaturePath() (path string) SiteFeatureTheme() (t Theme) SiteAuthSignInPath() (url string) SiteAuthSignOutPath() (url string) SiteAuthChallengePath() (path string) NumFactorsPresent() (count int) NumFactorsRequired() (count int) IsUserAllowed(email string) (allowed bool) GetSignUpsAllowed() (allowed bool) GetSessionDuration() (duration time.Duration) GetVerifiedDuration() (duration time.Duration) MakeAuthClaims(aud, email string, ctx context.Context) (claims *CSiteAuthClaims) GenerateJWT(claims *CSiteAuthClaims) (token string, err error) VerifyJWT(r *http.Request) (claims *CSiteAuthClaims, err error) ResetUserFactors(r *http.Request, eid string) (err error) SetUserFactor(r *http.Request, claim *CSiteAuthClaimsFactor) AuthorizeUserSignIn(w http.ResponseWriter, r *http.Request, claims *CSiteAuthClaims) (handled bool, modified *http.Request) SiteAuthRequestHandler ServeSignInPage(w http.ResponseWriter, r *http.Request) ServeSignOutPage(w http.ResponseWriter, r *http.Request) ServeChallengeRequest(w http.ResponseWriter, r *http.Request) ServeVerificationRequest(verifyTarget string, w http.ResponseWriter, r *http.Request) (handled bool, redirect string) RequireVerification(path string, w http.ResponseWriter, r *http.Request) (handled bool, redirect string) }
type SiteAuthProvider ¶ added in v0.5.0
type SiteAuthProvider interface { SiteFeature IsBackupProvider() (backup bool) SiteAuthLoginCallback(w http.ResponseWriter, r *http.Request, saf SiteAuthFeature) (err error) SiteAuthSignInHandler(w http.ResponseWriter, r *http.Request, saf SiteAuthFeature) (claims *CSiteAuthClaims, redirect string, err error) SiteAuthSignOutHandler(w http.ResponseWriter, r *http.Request, saf SiteAuthFeature) (handled bool, redirect string, err error) }
type SiteAuthRequestHandler ¶ added in v0.5.0
type SiteAuthRequestHandler interface { SiteFeature AuthenticateSiteRequest(w http.ResponseWriter, r *http.Request) (handled bool, modified *http.Request) FinalizeSiteRequest(w http.ResponseWriter, r *http.Request) (modified *http.Request) }
type SiteAuthSettingsPanel ¶ added in v0.5.0
type SiteAuthSettingsPanel interface { SiteFeature SiteAuthSettingsPanel(settingsPath string, saf SiteAuthFeature) (serve, handle http.HandlerFunc) }
type SiteFeature ¶ added in v0.5.0
type SiteFeature interface { Feature UserActionsProvider signaling.Signaling Site() (s Site) Action(verb string, details ...string) (action Action) SiteFeatureInfo(r *http.Request) (info *CSiteFeatureInfo) SiteFeatureKey() (name string) SiteFeatureIcon() (icon string) SiteFeaturePath() (path string) SiteFeatureMenu(r *http.Request) (m menu.Menu) SiteFeatureTheme() (t Theme) SiteFeatureLabel(printer *message.Printer) (label string) SetupSiteFeature(s Site) (err error) RouteSiteFeature(r chi.Router) SiteSettingsFields(r *http.Request) (fields beContext.Fields) SiteSettingsPanel(settingsPath string) (serve, handle http.HandlerFunc) }
type SiteFeatureLabelFn ¶ added in v0.5.0
type SiteFeatures ¶ added in v0.5.0
type SiteFeatures TypedFeatures[SiteFeature]
type SiteInfosLookup ¶ added in v0.5.0
type SiteInfosLookup[T interface{}] struct {
// contains filtered or unexported fields
}
func NewSiteInfosLookup ¶ added in v0.5.0
func NewSiteInfosLookup[T interface{}]() (lookup *SiteInfosLookup[T])
func (*SiteInfosLookup[T]) Get ¶ added in v0.5.0
func (l *SiteInfosLookup[T]) Get(key string) (info T)
func (*SiteInfosLookup[T]) Keys ¶ added in v0.5.0
func (l *SiteInfosLookup[T]) Keys() (keys []string)
func (*SiteInfosLookup[T]) Len ¶ added in v0.5.0
func (l *SiteInfosLookup[T]) Len() (count int)
func (*SiteInfosLookup[T]) Set ¶ added in v0.5.0
func (l *SiteInfosLookup[T]) Set(key string, info T)
type SiteMakeFeature ¶ added in v0.5.0
type SiteMakeFeature[MakeTypedFeature interface{}] interface { SetSiteFeatureKey(key string) MakeTypedFeature SetSiteFeatureIcon(icon string) MakeTypedFeature SetSiteFeatureTheme(name string) MakeTypedFeature SetSiteFeatureLabel(fn SiteFeatureLabelFn) MakeTypedFeature }
type SiteMultiFactorProvider ¶ added in v0.5.0
type SiteMultiFactorProvider interface { SiteFeature SiteUserSetupStage SetupSiteAuthProvider(saf SiteAuthFeature) IsMultiFactorBackup() (backup bool) SiteMultiFactorKey() (key string) SiteMultiFactorInfo(r *http.Request) (info *CSiteAuthMultiFactorInfo) SiteMultiFactorLabel(printer *message.Printer) (label string) CurrentUserFactorsReady(r *http.Request) (names []string) CurrentUserFactorsReadyCount(r *http.Request) (count int) ResetUserFactors(r *http.Request, eid string) (err error) ProcessSetupPage(saf SiteAuthFeature, w http.ResponseWriter, r *http.Request) (handled bool) ProcessChallenge(factor, challenge string, saf SiteAuthFeature, claims *CSiteAuthClaims, w http.ResponseWriter, r *http.Request) (handled bool, redirect string) VerifyClaimFactor(claim *CSiteAuthClaimsFactor, saf SiteAuthFeature, r *http.Request) (verified bool) ProcessVerification(verifyTarget, factor, challenge string, saf SiteAuthFeature, claims *CSiteAuthClaims, w http.ResponseWriter, r *http.Request) (handled bool, redirect string) }
type SiteRootFeature ¶ added in v0.5.0
type SiteRootFeature interface { SiteFeature SiteRootHandler() (this http.Handler) }
type SiteUserRequestModifier ¶ added in v0.5.1
type SiteUserSetupStage ¶ added in v0.5.0
type SiteUserSetupStage interface { SiteFeature SiteUserSetupStageReady(eid string, r *http.Request) (ready bool) SiteUserSetupStageHandler(saf SiteAuthFeature, w http.ResponseWriter, r *http.Request) }
type SiteUsersProvider ¶ added in v0.5.0
type SiteUsersProvider interface { Feature MakeRealID(email string) (rid string) MakeEnjinID(rid string) (eid string) GroupPresent(group Group) (present bool) CreateGroup(r *http.Request, group Group, permissions ...Action) (err error) RetrieveGroup(r *http.Request, group Group) (permissions Actions, err error) UpdateGroup(r *http.Request, group Group, permissions ...Action) (err error) DeleteGroup(r *http.Request, group Group) (err error) UserPresent(eid string) (present bool) IsUserLocked(r *http.Request, eid string) (locked bool) LockUser(r *http.Request, eid string) UnlockUser(r *http.Request, eid string) RLockUser(r *http.Request, eid string) RUnlockUser(r *http.Request, eid string) ListUsers(r *http.Request, pg, numPerPage int, sortDesc bool) (list []User, total int) SignUpUser(r *http.Request, claims *CSiteAuthClaims) (err error) CreateUser(r *http.Request, origin, rid, eid, email string) (err error) RetrieveUser(r *http.Request, eid string) (user User, err error) DeleteUser(r *http.Request, eid string) (err error) UpdateUserName(r *http.Request, eid string, name string) (err error) UpdateUserImage(r *http.Request, eid string, image string) (err error) UpdateUserContext(r *http.Request, eid string, ctx beContext.Context) (err error) UpdateUserGroups(r *http.Request, eid string, groups ...Group) (err error) UpdateUserPermissions(r *http.Request, eid string, permissions ...Action) (err error) SetUserName(r *http.Request, eid string, name string) (err error) SetUserImage(r *http.Request, eid string, image string) (err error) SetUserContext(r *http.Request, eid string, ctx beContext.Context) (err error) SetUserSetting(r *http.Request, eid string, key string, value interface{}) (err error) SetUserSettings(r *http.Request, eid string, ctx beContext.Context) (err error) SetUserGroups(r *http.Request, eid string, groups ...Group) (err error) SetUserPermissions(r *http.Request, eid string, permissions ...Action) (err error) UpdateUserActive(r *http.Request, eid string, active bool) (err error) UpdateUserAdminLocked(r *http.Request, eid string, active bool) (err error) SetUserActive(r *http.Request, eid string, active bool) (err error) SetUserAdminLocked(r *http.Request, eid string, active bool) (err error) GetUserStatus(r *http.Request, eid string) (active, locked, visitor bool, err error) GetUserActive(r *http.Request, eid string) (active bool, err error) GetUserAdminLocked(r *http.Request, eid string) (locked bool, err error) }
type SyncLocker ¶ added in v0.5.0
type SyncLockerFactory ¶ added in v0.5.0
type SyncLockerFactory interface { NewSyncLocker(tag Tag, key string, store KeyValueStore) (l SyncLocker) NewSyncLockerWith(tag Tag, key string, store KeyValueStore, timeout, interval time.Duration) (l SyncLocker) NewSyncRWLocker(tag Tag, key string, readStore, writeStore KeyValueStore) (l SyncRWLocker) NewSyncRWLockerWith(tag Tag, key string, readStore, writeStore KeyValueStore, timeout, interval time.Duration) (l SyncRWLocker) }
type SyncLockerFactoryFeature ¶ added in v0.5.0
type SyncLockerFactoryFeature interface { Feature SyncLockerFactory }
type SyncRWLocker ¶ added in v0.5.0
type SyncRWLocker interface { SyncLocker RLock(key string) RUnlock(key string) }
type Tag ¶
type Tag string
Tag is the primary identifier type for enjin Feature implementations
const (
NilTag Tag = ""
)
const NotImplemented Tag = "not-implemented"
func (Tag) Equal ¶ added in v0.4.0
Equal returns true if the kebab-case of this Tag is the same as the kebab-case of the other Tag
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
func (Tag) Spaced ¶ added in v0.5.0
Spaced returns the tag as a space cased string (all lowercase, separated by spaces)
func (Tag) SpacedCamel ¶ added in v0.5.0
SpacedCamel returns the tag as a Spaced Camel Cased string (first letters capitalized, separated by spaces)
type TagCloudProvider ¶ added in v0.5.11
type Tags ¶
type Tags []Tag
func SortedFeatureTags ¶ added in v0.1.0
SortedFeatureTags returns a natural.StringSlice list of Tag keys
func StringsAsTags ¶ added in v0.1.0
StringsAsTags returns a list of Tags based on the names given
func (Tags) Find ¶ added in v0.5.0
Find returns the first tag matching the given name exactly, or matching by kebab-cased comparison
type TemplatePartialsProvider ¶ added in v0.4.0
type Theme ¶ added in v0.4.0
type Theme interface { Name() (name string) GetParent() (parent Theme) GetBlockThemeNames() (names []string) ThemeFS() fs.FileSystem StaticFS() fs.FileSystem Locales() (locales fs.FileSystem, ok bool) ReadStaticFile(path string) (data []byte, mime string, err error) GetConfig() (config *ThemeConfig) Layouts() ThemeLayouts FindLayout(named string) (layout ThemeLayout, name string, ok bool) ListArchetypes() (names []string) MakeArchetype(enjin Internals, name string) (format string, data []byte, err error) AddFormatProvider(providers ...PageFormatProvider) PageFormatProvider Middleware(next http.Handler) http.Handler NewHtmlTemplate(enjin Internals, name string, ctx context.Context) (tmpl *htmlTemplate.Template, err error) NewTextTemplate(enjin Internals, name string, ctx context.Context) (tmpl *textTemplate.Template, err error) }
type ThemeAuthor ¶ added in v0.5.1
type ThemeConfig ¶ added in v0.4.0
type ThemeConfig struct { Name string Parent string License string LicenseLink string Description string Homepage string Authors []ThemeAuthor Extends string RootStyles []template.CSS BlockStyles map[string][]template.CSS BlockThemes map[string]map[string]interface{} FontawesomeLinks map[string]string FontawesomeClasses []string CacheControl string PermissionsPolicy []permissions.Directive ContentSecurityPolicy csp.ContentSecurityPolicyConfig Supports ThemeSupports Context context.Context Err error }
func (*ThemeConfig) Copy ¶ added in v0.5.1
func (tc *ThemeConfig) Copy() (config *ThemeConfig)
type ThemeLayout ¶ added in v0.4.0
type ThemeLayout interface { Name() (name string) Apply(other ThemeLayout) CacheKeys() (keys []string) CacheValue(key string) (value string) NewHtmlTemplate(enjin Internals, ctx context.Context) (tmpl *htmlTemplate.Template, err error) NewTextTemplate(enjin Internals, ctx context.Context) (tmpl *textTemplate.Template, err error) NewHtmlTemplateFrom(enjin Internals, parent ThemeLayout, ctx context.Context) (tmpl *htmlTemplate.Template, err error) NewTextTemplateFrom(enjin Internals, parent ThemeLayout, ctx context.Context) (tmpl *textTemplate.Template, err error) ApplyHtmlTemplate(enjin Internals, tt *htmlTemplate.Template, ctx context.Context) (err error) ApplyTextTemplate(enjin Internals, tt *textTemplate.Template, ctx context.Context) (err error) }
type ThemeLayouts ¶ added in v0.4.0
type ThemeLayouts interface { ListLayouts() (names []string) GetLayout(name string) (layout ThemeLayout) SetLayout(name string, layout ThemeLayout) NewHtmlTemplate(enjin Internals, name string, ctx context.Context) (tmpl *htmlTemplate.Template, err error) NewTextTemplate(enjin Internals, name string, ctx context.Context) (tmpl *textTemplate.Template, err error) ApplyHtmlTemplates(enjin Internals, tmpl *htmlTemplate.Template, ctx context.Context) (err error) ApplyTextTemplates(enjin Internals, tmpl *textTemplate.Template, ctx context.Context) (err error) }
type ThemeRenderer ¶ added in v0.4.0
type ThemeRenderer interface { Feature Render(t Theme, view string, ctx context.Context) (data []byte, err error) RenderPage(t Theme, ctx context.Context, p Page) (data []byte, redirect string, err error) PrepareRenderPage(t Theme, ctx context.Context, p Page) (data htmlTemplate.HTML, redirect string, err error) NewHtmlTemplateWith(t Theme, name string, ctx context.Context) (tt *htmlTemplate.Template, err error) NewTextTemplateWith(t Theme, name string, ctx context.Context) (tt *textTemplate.Template, err error) RenderHtmlTemplateContent(t Theme, ctx context.Context, tmplContent string) (rendered string, err error) RenderTextTemplateContent(t Theme, ctx context.Context, tmplContent string) (rendered string, err error) NewHtmlTemplateFromContext(t Theme, view string, ctx context.Context) (tt *htmlTemplate.Template, err error) NewTextTemplateFromContext(t Theme, view string, ctx context.Context) (tt *textTemplate.Template, err error) }
type ThemeSupports ¶ added in v0.5.0
type TokenFactory ¶ added in v0.5.0
type TokenFactoryFeature ¶ added in v0.5.0
type TokenFactoryFeature interface { Feature TokenFactory }
type TransformOutputFn ¶
type TranslateOutputFn ¶
type TypedFeatures ¶ added in v0.5.0
type TypedFeatures[T interface{}] []T
func (TypedFeatures[T]) AsFeatures ¶ added in v0.5.0
func (tf TypedFeatures[T]) AsFeatures() (features Features)
func (TypedFeatures[T]) Find ¶ added in v0.5.0
func (tf TypedFeatures[T]) Find(name string) (tag Tag)
func (TypedFeatures[T]) Get ¶ added in v0.5.0
func (tf TypedFeatures[T]) Get(tag Tag) (found T)
func (TypedFeatures[T]) Has ¶ added in v0.5.0
func (tf TypedFeatures[T]) Has(tag Tag) (present bool)
func (TypedFeatures[T]) Len ¶ added in v0.5.0
func (tf TypedFeatures[T]) Len() (count int)
func (TypedFeatures[T]) Tags ¶ added in v0.5.0
func (tf TypedFeatures[T]) Tags() (tags Tags)
type UpdateSiteRoutesFeature ¶ added in v0.5.0
type UpdateSiteRoutesFeature interface { SiteFeature UpdateSiteRoutes(r chi.Router) }
type UseMiddleware ¶ added in v0.1.0
type UseMiddleware interface { Feature Use(s System) MiddlewareFn }
type User ¶ added in v0.5.0
type User interface { GetRID() (rid string) GetEID() (eid string) GetName() (name string) GetEmail() (email string) GetImage() (image string) GetOrigin() (origin string) GetGroups() (groups Groups) GetActions() (groups Actions) GetActive() (active bool) GetAdminLocked() (locked bool) GetSetting(key string) (value interface{}) GetSettings(includeKeys ...string) (settings context.Context) UnsafeContext() (ctx context.Context) SafeContext(includeKeys ...string) (ctx context.Context) Can(action ...Action) (allowed bool) CanAll(action ...Action) (allowed bool) IsVisitor() (visitor bool) Bytes() (data []byte) }
type UserActionsProvider ¶ added in v0.5.0
type UserManager ¶ added in v0.5.0
type UserManager interface { Feature // NewUser constructs a new User instance and saves it to the userbase NewUser(rid, name, email, picture, audience string, attributes map[string]interface{}) (user User, err error) // SetUser writes the given User to the system SetUser(user User) (err error) // RemoveUser deletes a user from the system RemoveUser(eid string) (err error) }
type UserNotice ¶ added in v0.5.0
type UserNotice struct { Type string `json:"type"` Dismiss bool `json:"dismiss"` Summary string `json:"summary"` Content []string `json:"content"` Actions []UserNoticeLink `json:"actions"` }
func MakeErrorNotice ¶ added in v0.5.0
func MakeErrorNotice(dismiss bool, message string, argv ...interface{}) (notice *UserNotice)
func MakeImportantNotice ¶ added in v0.5.0
func MakeImportantNotice(dismiss bool, message string, argv ...interface{}) (notice *UserNotice)
func MakeInfoNotice ¶ added in v0.5.0
func MakeInfoNotice(dismiss bool, message string, argv ...interface{}) (notice *UserNotice)
func MakeWarnNotice ¶ added in v0.5.0
func MakeWarnNotice(dismiss bool, message string, argv ...interface{}) (notice *UserNotice)
func NewNotice ¶ added in v0.5.0
func NewNotice(key string, dismiss bool, summary string, actions ...UserNoticeLink) (notice *UserNotice)
type UserNoticeLink ¶ added in v0.5.0
type UserNotices ¶ added in v0.5.0
type UserNotices []*UserNotice
func GetUserNotices ¶ added in v0.5.0
func GetUserNotices(r *http.Request) (notices UserNotices)
type UserProvider ¶ added in v0.5.0
type ValueStubPair ¶ added in v0.4.0
type ValueStubPair struct { Value interface{} Stub *PageStub }
Source Files ¶
- action.go
- actions.go
- buildable.go
- builder.go
- console_stub.go
- db.go
- editor-feature.go
- editor-operation.go
- editor-signals.go
- editor-site.go
- email.go
- enjin.go
- factory-nonce.go
- factory-synclocker.go
- factory-token.go
- feature-life-cycle-state.go
- feature-optional.go
- feature.go
- features-cache.go
- features-typed.go
- features-utils.go
- features.go
- filesystem-feature.go
- filesystem-mountpoints.go
- funcmaps.go
- kvs-types.go
- locales.go
- menu.go
- message-printer.go
- middleware.go
- njn.go
- njn_block.go
- njn_field.go
- njn_renderer.go
- njn_system.go
- nonces.go
- notify.go
- output.go
- page-features.go
- page-format.go
- page-handlers.go
- page-indexing.go
- page-matchers.go
- page-raw.go
- page-stub.go
- page-stubs.go
- page-tag-cloud.go
- page.go
- pages.go
- panics.go
- preset.go
- processor.go
- request.go
- runner.go
- service.go
- site-auth-claims-factor.go
- site-auth-claims-factors.go
- site-auth-claims.go
- site-auth-feature.go
- site-auth-provider.go
- site-auth-request.go
- site-feature-infos-lookup.go
- site-feature-infos.go
- site-feature.go
- site-routes.go
- site-user-provider.go
- site.go
- sync-lockers.go
- system.go
- tag.go
- tags.go
- theme-config.go
- theme-menus.go
- theme.go
- user-group.go
- user-groups.go
- user-notices.go
- user.go
- userbase.go