Documentation ¶
Overview ¶
Package build contains build objects, which are passed to HTML templates to generate HTML pages. Render objects wrap a specific model object, providing some safety against direct access to protected data. Render objects also include additional methods to query related records in the database. For example, the "Stream" builder has queries for `Ancestors`, `Parent`, `Siblings`, and `Children` streams.
This package also contains implementations for all the action steps available to template designers.
Index ¶
- func CloseModal(ctx echo.Context)
- func FuncMap(icons icon.Provider) template.FuncMap
- func RefreshPage(ctx echo.Context)
- func TriggerEvent(ctx echo.Context, event string)
- func WrapForm(endpoint string, content string, options ...string) string
- func WrapInlineError(response http.ResponseWriter, err error) error
- func WrapInlineSuccess(response http.ResponseWriter, message any) error
- func WrapModal(response http.ResponseWriter, content string, options ...string) string
- func WrapModalForm(response http.ResponseWriter, endpoint string, content string, ...) string
- func WrapModalWithCloseButton(response http.ResponseWriter, content string, options ...string) string
- func WrapTooltip(response http.ResponseWriter, content string) string
- type ActionMethod
- type Builder
- type Common
- func (w Common) Action() model.Action
- func (w Common) ActionID() string
- func (w Common) ActivityStream(url string) streams.Document
- func (w Common) ActivityStreamActor(url string) streams.Document
- func (w Common) ActivityStreamActors(search string) ([]model.ActorSummary, error)
- func (w Common) AdminSections() []form.LookupCode
- func (w Common) AuthenticatedID() primitive.ObjectID
- func (w Common) DomainHasSignupForm() (bool, error)
- func (w Common) DomainLabel() (string, error)
- func (w Common) GetBool(name string) bool
- func (w Common) GetContent() template.HTML
- func (w Common) GetFloat(name string) float64
- func (w Common) GetFollowingID(url string) string
- func (w Common) GetHTML(name string) template.HTML
- func (w Common) GetInt(name string) int
- func (w Common) GetInt64(name string) int64
- func (w Common) GetResponseID(responseType string, url string) string
- func (w Common) GetResponseSummary(url string) model.UserResponseSummary
- func (w Common) GetString(name string) string
- func (w Common) Host() string
- func (w Common) Hostname() string
- func (w Common) IsAuthenticated() bool
- func (w Common) IsMe(url string) bool
- func (w Common) IsOwner() bool
- func (w Common) IsPartialRequest() bool
- func (w Common) Method() string
- func (w Common) Navigation() (sliceof.Object[model.StreamSummary], error)
- func (w Common) NavigationID() string
- func (w Common) NotMe(url string) bool
- func (w Common) Now() int64
- func (w Common) PageTitle() string
- func (w Common) Path() string
- func (w Common) PathList() list.List
- func (w Common) Protocol() string
- func (w Common) QueryParam(param string) string
- func (w Common) QueryString() template.URL
- func (w Common) SetContent(value string)
- func (w Common) SetQueryParam(name string, value string)
- func (w Common) SubBuilder(object any) (Builder, error)
- func (w Common) Summary() string
- func (w Common) URL() string
- func (w Common) UserCan(_ string) bool
- func (w Common) UserImage() (string, error)
- func (w Common) UserName() (string, error)
- type DocumentLinker
- type Domain
- func (w Domain) BasePath() string
- func (w Domain) Client(providerID string) model.Client
- func (w Domain) NavigationID() string
- func (w Domain) PageTitle() string
- func (w Domain) Permalink() string
- func (w Domain) Provider(providerID string) providers.Provider
- func (w Domain) Providers() []form.LookupCode
- func (w Domain) Render() (template.HTML, error)
- func (w Domain) SignupForm() model.SignupForm
- func (w Domain) Theme(themeID string) model.Theme
- func (w Domain) ThemeID() string
- func (w Domain) Themes() []model.Theme
- func (w Domain) Token() string
- func (w Domain) View(actionID string) (template.HTML, error)
- type Factory
- type Group
- func (w Group) BasePath() string
- func (w Group) GroupID() string
- func (w Group) Groups() *QueryBuilder[model.Group]
- func (w Group) Label() string
- func (w Group) NavigationID() string
- func (w Group) PageTitle() string
- func (w Group) Permalink() string
- func (w Group) Render() (template.HTML, error)
- func (w Group) Token() string
- func (w Group) View(actionID string) (template.HTML, error)
- type Inbox
- func (w Inbox) AmFollowing(url string) model.Following
- func (w Inbox) AnnouncesBefore(url string, dateString string, maxRows int) sliceof.Object[streams.Document]
- func (w Inbox) BasePath() string
- func (w Inbox) DisplayName() string
- func (w Inbox) FilteredByFollowing() model.Following
- func (w Inbox) Folders() (model.FolderList, error)
- func (w Inbox) FoldersWithSelection() (model.FolderList, error)
- func (w Inbox) FollowerCount() int
- func (w Inbox) Followers() QueryBuilder[model.FollowerSummary]
- func (w Inbox) Following() QueryBuilder[model.FollowingSummary]
- func (w Inbox) FollowingByFolder(token string) ([]model.FollowingSummary, error)
- func (w Inbox) FollowingByToken(followingToken string) (model.Following, error)
- func (w Inbox) FollowingCount() int
- func (w Inbox) HasRule(ruleType string, trigger string) model.Rule
- func (w Inbox) ImageURL() string
- func (w Inbox) Inbox() (QueryBuilder[model.Message], error)
- func (w Inbox) IsInboxEmpty(inbox []model.Message) bool
- func (w Inbox) LikesBefore(url string, dateString string, maxRows int) sliceof.Object[streams.Document]
- func (w Inbox) Message() model.Message
- func (w Inbox) Myself() bool
- func (w Inbox) NavigationID() string
- func (w Inbox) PageTitle() string
- func (w Inbox) Permalink() string
- func (w Inbox) ProfileURL() string
- func (w Inbox) Render() (template.HTML, error)
- func (w Inbox) RepliesAfter(url string, dateString string, maxRows int) sliceof.Object[streams.Document]
- func (w Inbox) RepliesBefore(url string, dateString string, maxRows int) sliceof.Object[streams.Document]
- func (w Inbox) RuleByToken(token string) model.Rule
- func (w Inbox) RuleCount() int
- func (w Inbox) Rules() QueryBuilder[model.Rule]
- func (w Inbox) Token() string
- func (w Inbox) UserCan(actionID string) bool
- func (w Inbox) UserID() string
- func (w Inbox) Username() string
- func (w Inbox) View(actionID string) (template.HTML, error)
- type Model
- func (w Model) BasePath() string
- func (w Model) Label() string
- func (w Model) Object() any
- func (w Model) ObjectID() string
- func (w Model) PageTitle() string
- func (w Model) Permalink() string
- func (w Model) Render() (template.HTML, error)
- func (w Model) Token() string
- func (w Model) UserCan(string) bool
- func (w Model) View(actionID string) (template.HTML, error)
- type Navigation
- func (w Navigation) BasePath() string
- func (w Navigation) NavigationID() string
- func (w Navigation) PageTitle() string
- func (w Navigation) Permalink() string
- func (w Navigation) Render() (template.HTML, error)
- func (w Navigation) Token() string
- func (w Navigation) View(actionID string) (template.HTML, error)
- type OAuthAuthorization
- func (r OAuthAuthorization) ClientID() string
- func (r OAuthAuthorization) Name() string
- func (r OAuthAuthorization) RedirectURI() string
- func (r OAuthAuthorization) ResponseType() string
- func (r OAuthAuthorization) Scope() string
- func (r OAuthAuthorization) Scopes() []string
- func (r OAuthAuthorization) Website() string
- type Outbox
- func (w Outbox) ActivityPubAvatarURL() string
- func (w Outbox) ActivityPubFollowersURL() string
- func (w Outbox) ActivityPubFollowingURL() string
- func (w Outbox) ActivityPubInboxURL() string
- func (w Outbox) ActivityPubLikedURL() string
- func (w Outbox) ActivityPubOutboxURL() string
- func (w Outbox) ActivityPubPublicKeyURL() string
- func (w Outbox) ActivityPubURL() string
- func (w Outbox) BasePath() string
- func (w Outbox) DisplayName() string
- func (w Outbox) FollowerCount() int
- func (w Outbox) FollowingCount() int
- func (w Outbox) ImageURL() string
- func (w Outbox) IsMyself() bool
- func (w Outbox) Links() []model.PersonLink
- func (w Outbox) Location() string
- func (w Outbox) Myself() bool
- func (w Outbox) NavigationID() string
- func (w Outbox) Outbox() QueryBuilder[model.StreamSummary]
- func (w Outbox) PageTitle() string
- func (w Outbox) Permalink() string
- func (w Outbox) ProfileURL() string
- func (w Outbox) Render() (template.HTML, error)
- func (w Outbox) Replies() QueryBuilder[model.StreamSummary]
- func (w Outbox) Responses() QueryBuilder[model.Response]
- func (w Outbox) RuleCount() int
- func (w Outbox) StatusMessage() string
- func (w Outbox) Token() string
- func (w Outbox) UserCan(actionID string) bool
- func (w Outbox) UserID() string
- func (w Outbox) Username() string
- func (w Outbox) View(actionID string) (template.HTML, error)
- type Pipeline
- func (pipeline Pipeline) Execute(factory Factory, builder Builder, buffer io.Writer, actionMethod ActionMethod) PipelineResult
- func (pipeline Pipeline) Get(factory Factory, builder Builder, buffer io.Writer) PipelineResult
- func (pipeline Pipeline) IsEmpty() bool
- func (pipeline Pipeline) Post(factory Factory, builder Builder, buffer io.Writer) PipelineResult
- type PipelineBehavior
- func (exit PipelineBehavior) AsFullPage() PipelineBehavior
- func (exit PipelineBehavior) RemoveEvent(name string) PipelineBehavior
- func (exit PipelineBehavior) WithContentType(contentType string) PipelineBehavior
- func (exit PipelineBehavior) WithError(err error) PipelineBehavior
- func (exit PipelineBehavior) WithEvent(name string, value string) PipelineBehavior
- func (exit PipelineBehavior) WithHeader(name string, value string) PipelineBehavior
- func (exit PipelineBehavior) WithStatusCode(statusCode int) PipelineBehavior
- type PipelineHalter
- type PipelineResult
- type QueryBuilder
- func (builder QueryBuilder[T]) All() QueryBuilder[T]
- func (builder QueryBuilder[T]) By(sortField string) QueryBuilder[T]
- func (builder QueryBuilder[T]) ByCreateDate() QueryBuilder[T]
- func (builder QueryBuilder[T]) ByDisplayName() QueryBuilder[T]
- func (builder QueryBuilder[T]) ByExpirationDate() QueryBuilder[T]
- func (builder QueryBuilder[T]) ByLabel() QueryBuilder[T]
- func (builder QueryBuilder[T]) ByPublishDate() QueryBuilder[T]
- func (builder QueryBuilder[T]) ByRank() QueryBuilder[T]
- func (builder QueryBuilder[T]) ByReadDate() QueryBuilder[T]
- func (builder QueryBuilder[T]) ByUpdateDate() QueryBuilder[T]
- func (builder QueryBuilder[T]) Reverse() QueryBuilder[T]
- func (builder QueryBuilder[T]) Slice() (sliceof.Object[T], error)
- func (builder QueryBuilder[T]) Top1() QueryBuilder[T]
- func (builder QueryBuilder[T]) Top12() QueryBuilder[T]
- func (builder QueryBuilder[T]) Top120() QueryBuilder[T]
- func (builder QueryBuilder[T]) Top30() QueryBuilder[T]
- func (builder QueryBuilder[T]) Top6() QueryBuilder[T]
- func (builder QueryBuilder[T]) Top60() QueryBuilder[T]
- func (builder QueryBuilder[T]) Top600() QueryBuilder[T]
- type Rule
- func (w Rule) BasePath() string
- func (w Rule) Label() string
- func (w Rule) NavigationID() string
- func (w Rule) PageTitle() string
- func (w Rule) Permalink() string
- func (w Rule) Render() (template.HTML, error)
- func (w Rule) RuleID() string
- func (w Rule) Rules() *QueryBuilder[model.Rule]
- func (w Rule) ServerWideRules() *QueryBuilder[model.Rule]
- func (w Rule) Token() string
- func (w Rule) View(actionID string) (template.HTML, error)
- type ServerFactory
- type StateSetter
- type Step
- type StepAddModelObject
- type StepAddStream
- type StepAsConfirmation
- type StepAsModal
- type StepAsTooltip
- type StepDelete
- type StepDeleteAttachments
- type StepDo
- type StepEditConnection
- type StepEditContent
- type StepEditModelObject
- type StepEditWidget
- type StepError
- type StepForwardTo
- type StepHalt
- type StepIfCondition
- type StepInlineError
- type StepInlineSuccess
- type StepProcessContent
- type StepPublish
- type StepRedirectTo
- type StepRefreshPage
- type StepReloadPage
- type StepRemoveEvent
- type StepSave
- type StepSendEmail
- type StepServerRedirect
- type StepSetData
- type StepSetHeader
- type StepSetQueryParam
- type StepSetRenderData
- type StepSetResponse
- type StepSetResponseTransaction
- type StepSetSimpleSharing
- type StepSetState
- type StepSetThumbnail
- type StepSort
- type StepSortAttachments
- type StepSortWidgets
- type StepStreamPromoteDraft
- type StepTableEditor
- type StepTriggerEvent
- type StepUnPublish
- type StepUploadAttachment
- type StepViewFeed
- type StepViewHTML
- type StepViewJSONLD
- type StepWebSub
- type StepWithChildren
- type StepWithDraft
- type StepWithFolder
- type StepWithFollower
- type StepWithFollowing
- type StepWithMessage
- type StepWithNextSibling
- type StepWithParent
- type StepWithPrevSibling
- type StepWithResponse
- type StepWithRule
- type Stream
- func NewStream(factory Factory, request *http.Request, response http.ResponseWriter, ...) (Stream, error)
- func NewStreamFromURI(serverFactory ServerFactory, request *http.Request, ...) (Stream, error)
- func NewStreamWithoutTemplate(factory Factory, request *http.Request, response http.ResponseWriter, ...) (Stream, error)
- func (w Stream) Ancestors() QueryBuilder[model.StreamSummary]
- func (w Stream) AnnouncesBefore(dateString string, maxRows int) sliceof.Object[streams.Document]
- func (w Stream) Attachment() (model.Attachment, error)
- func (w Stream) Attachments() ([]model.Attachment, error)
- func (w Stream) AttributedTo() model.PersonLink
- func (w Stream) Author() model.PersonLink
- func (w Stream) BasePath() string
- func (w Stream) Breadcrumbs() ([]model.StreamSummary, error)
- func (w Stream) CanCreate() []form.LookupCode
- func (w Stream) Children() QueryBuilder[model.StreamSummary]
- func (w Stream) ContentHTML() template.HTML
- func (w Stream) ContentRaw() string
- func (w Stream) CreateDate() int64
- func (w Stream) Data(value string) any
- func (w Stream) Document() model.DocumentLink
- func (w Stream) FirstChild(sort string, action string) (Stream, error)
- func (w Stream) Following() ([]model.Following, error)
- func (w Stream) HasParent() bool
- func (w Stream) ImageURL() string
- func (w Stream) InReplyTo() streams.Document
- func (w Stream) IsCurrentStream() bool
- func (w Stream) IsEmpty() bool
- func (w Stream) IsNew() bool
- func (w Stream) IsReply() bool
- func (w Stream) Label() string
- func (w Stream) LastChild(sort string, action string) (Stream, error)
- func (w Stream) LikesBefore(dateString string, maxRows int) sliceof.Object[streams.Document]
- func (w Stream) ListAllWidgets() []form.LookupCode
- func (w Stream) ListWidgetsByLocation(location string) []model.StreamWidget
- func (w Stream) Mentions() ([]model.Mention, error)
- func (w Stream) NavigationID() string
- func (w Stream) NextSibling(sortField string, action string) (Stream, error)
- func (w Stream) PageTitle() string
- func (w Stream) Parent(actionID string) (Stream, error)
- func (w Stream) ParentID() string
- func (w Stream) Permalink() string
- func (w Stream) PrevSibling(sortField string, action string) (Stream, error)
- func (w Stream) PublishDate() int64
- func (w Stream) Rank() int
- func (w Stream) Render() (template.HTML, error)
- func (w Stream) RepliesAfter(dateString string, maxRows int) sliceof.Object[streams.Document]
- func (w Stream) RepliesBefore(dateString string, maxRows int) sliceof.Object[streams.Document]
- func (w Stream) Roles() []string
- func (w Stream) ShortSummary() string
- func (w Stream) Siblings() QueryBuilder[model.StreamSummary]
- func (w Stream) StateID() string
- func (w Stream) StreamID() string
- func (w Stream) Summary() string
- func (w Stream) SummaryHTML() template.HTML
- func (w Stream) TemplateID() string
- func (w Stream) Token() string
- func (w Stream) UpdateDate() int64
- func (w Stream) UserCan(actionID string) bool
- func (w Stream) View(actionID string) (template.HTML, error)
- func (w Stream) Widgets(location string) (template.HTML, error)
- type TemplateLike
- type User
- func (w User) AssignedGroups() ([]model.Group, error)
- func (w User) BasePath() string
- func (w User) DisplayName() string
- func (w User) ImageURL() string
- func (w User) Label() string
- func (w User) NavigationID() string
- func (w User) PageTitle() string
- func (w User) Permalink() string
- func (w User) Render() (template.HTML, error)
- func (w User) SignupForm() model.SignupForm
- func (w User) Token() string
- func (w User) UserID() string
- func (w User) Users() *QueryBuilder[model.UserSummary]
- func (w User) View(actionID string) (template.HTML, error)
- type Widget
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloseModal ¶
func CloseModal(ctx echo.Context)
CloseModal sets Response header to close a modal on the client and optionally forward to a new location.
func RefreshPage ¶
func RefreshPage(ctx echo.Context)
func TriggerEvent ¶
func TriggerEvent(ctx echo.Context, event string)
func WrapInlineError ¶
func WrapInlineError(response http.ResponseWriter, err error) error
WrapInlineError sends an error message to the #htmx-response-message element
func WrapInlineSuccess ¶
func WrapInlineSuccess(response http.ResponseWriter, message any) error
WrapInlineSuccess sends a confirmation message to the #htmx-response-message element
func WrapModal ¶
func WrapModal(response http.ResponseWriter, content string, options ...string) string
func WrapModalForm ¶
func WrapModalWithCloseButton ¶
func WrapModalWithCloseButton(response http.ResponseWriter, content string, options ...string) string
func WrapTooltip ¶
func WrapTooltip(response http.ResponseWriter, content string) string
Types ¶
type ActionMethod ¶
type ActionMethod uint8
ActionMethod enumerates the HTTP methods that can be performed on Actions
const ActionMethodGet ActionMethod = 0
ActionMethodGet signifies a GET operation on an action
const ActionMethodPost ActionMethod = 1
ActionMethodPost signifies a POST operation on an action
type Builder ¶
type Builder interface { // Render is the main entry-point for templates to use a Builder Render() (template.HTML, error) // Render function outputs an HTML template View(string) (template.HTML, error) // Render function outputs an HTML template // COMMON API METHODS Host() string // String representation of the protocol + hostname Protocol() string // String representation of the HTTP protocol to use when addressing this record (http:// or https://) Hostname() string // Hostname for this server Token() string // URL Token of the record being builded PageTitle() string // Human-friendly title to put at the top of the page. Summary() string // Human-friendly summary to put at the top of the page (maybe) Permalink() string // Permanent link to the record being builded BasePath() string // URL Path of the root of this object, without any additional actions. URL() string // Complete URL of the requested page QueryParam(string) string // Query parameter of the requested page SetQueryParam(string, string) // Sets a queryString parameter ActionID() string // Token that identifies the action requested via the URL. Action() model.Action // The pipeline action to be taken by this builder IsAuthenticated() bool // Returns TRUE if the user is signed in IsPartialRequest() bool // Returns TRUE if this is an HTMX request for a page fragment UserCan(string) bool // Returns TRUE if the signed-in user has access to the named action AuthenticatedID() primitive.ObjectID // Returns the ID of the signed-in user (or zero if not signed in) GetBool(name string) bool GetFloat(name string) float64 GetHTML(name string) template.HTML GetInt(name string) int GetInt64(name string) int64 GetString(name string) string GetContent() template.HTML SetContent(string) // contains filtered or unexported methods }
Builder safely wraps model objects for consumption by an html Template
type Common ¶
type Common struct {
// contains filtered or unexported fields
}
Common provides common building functions that are needed by ALL builders
func (Common) ActivityStream ¶
ActivityStream returns an ActivityStream document for the provided URL. The returned document uses Emissary's custom ActivityStream service, which uses document values and rules from the server's shared cache.
func (Common) ActivityStreamActor ¶
ActivityStreamActor returns an ActivityStream actor document for the provided URL. The returned document uses Emissary's custom ActivityStream service, which uses document values and rules from the server's shared cache.
func (Common) ActivityStreamActors ¶
func (w Common) ActivityStreamActors(search string) ([]model.ActorSummary, error)
func (Common) AdminSections ¶
func (w Common) AdminSections() []form.LookupCode
AdminSections returns labels and values for all hard-coded sections of the administrator area.
func (Common) AuthenticatedID ¶
AuthenticatedID returns the unique ID of the currently logged in user (may be nil).
func (Common) DomainHasSignupForm ¶
func (Common) DomainLabel ¶
func (Common) GetContent ¶
func (Common) GetFollowingID ¶
IsFollowing returns TRUE if the curren user is following the document at a specific URI (or the actor who created the document)
func (Common) GetResponseSummary ¶
func (w Common) GetResponseSummary(url string) model.UserResponseSummary
func (Common) IsAuthenticated ¶
IsAuthenticated returns TRUE if the user is signed in
func (Common) IsPartialRequest ¶
IsPartialRequest returns TRUE if this is a partial page request from htmx.
func (Common) Navigation ¶
Navigation returns an array of Streams that have a Zero ParentID
func (Common) NavigationID ¶
NavigationID returns the the identifier of the top-most stream in the navigation. The "common" builder just returns a default value that other builders should override.
func (Common) NotMe ¶
NotMe returns TRUE if the provided URI is NOT the ProfileURL of the current user
func (Common) QueryParam ¶
Returns the designated request parameter. If there are multiple values for the parameter, then only the first value is returned.
func (Common) QueryString ¶
QueryString returns the raw query string (encoded as a template.URL) to be re-embedded in a template link.
func (Common) SetContent ¶
func (Common) SetQueryParam ¶
SetQueryParam updates the HTTP request, setting a new value for an individual query parameter.
func (Common) SubBuilder ¶
SubBuilder creates a new builder for a child object. This function works with Rule, Folder, Follower, Following, and Stream objects. It will return an error if the object is not one of those types.
func (Common) UserCan ¶
UserCan returns TRUE if the current user has the specified permission. Default implementation returns FALSE for all requests.
type DocumentLinker ¶
type DocumentLinker interface {
DocumentLink() model.DocumentLink
}
type Domain ¶
type Domain struct { Common // contains filtered or unexported fields }
Domain is the builder for the admin/domain page It can only be accessed by a Domain Owner
func NewDomain ¶
func NewDomain(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, actionID string) (Domain, error)
NewDomain returns a fully initialized `Domain` builder.
func (Domain) NavigationID ¶
func (Domain) Providers ¶
func (w Domain) Providers() []form.LookupCode
func (Domain) SignupForm ¶
func (w Domain) SignupForm() model.SignupForm
SignupForm returns the SignupForm associated with this Domain.
type Factory ¶
type Factory interface { // Model Services ActivityStream() *service.ActivityStream Attachment() *service.Attachment Rule() *service.Rule Folder() *service.Folder Following() *service.Following Follower() *service.Follower Group() *service.Group Inbox() *service.Inbox Mention() *service.Mention Outbox() *service.Outbox Provider() *service.Provider Response() *service.Response Stream() *service.Stream StreamDraft() *service.StreamDraft Template() *service.Template Theme() *service.Theme User() *service.User Widget() *service.Widget // Other data services Config() config.Domain Content() *service.Content Domain() *service.Domain Email() *service.DomainEmail Host() string Hostname() string Icons() icon.Provider MediaServer() mediaserver.MediaServer ModelService(data.Object) service.ModelService Locator() service.Locator LookupProvider(primitive.ObjectID) form.LookupProvider OAuthClient() *service.OAuthClient OAuthUserToken() *service.OAuthUserToken Providers() set.Slice[config.Provider] Queue() queue.Queue Steranko() *steranko.Steranko StreamUpdateChannel() chan model.Stream }
Factory is used to locate all necessary services
type Group ¶
type Group struct { Common // contains filtered or unexported fields }
Group is a builder for the admin/groups page It can only be accessed by a Domain Owner
func NewGroup ¶
func NewGroup(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, group *model.Group, actionID string) (Group, error)
NewGroup returns a fully initialized `Group` builder.
func (Group) NavigationID ¶
type Inbox ¶
type Inbox struct { Common // contains filtered or unexported fields }
Inbox is a builder for the @user/inbox page
func NewInbox ¶
func NewInbox(factory Factory, request *http.Request, response http.ResponseWriter, user *model.User, actionID string) (Inbox, error)
NewInbox returns a fully initialized `Inbox` builder
func (Inbox) AnnouncesBefore ¶
func (Inbox) DisplayName ¶
func (Inbox) FilteredByFollowing ¶
FIlteredByFollowing returns the Following record that is being used to filter the Inbox
func (Inbox) Folders ¶
func (w Inbox) Folders() (model.FolderList, error)
Folders returns a slice of all folders owned by the current User
func (Inbox) FoldersWithSelection ¶
func (w Inbox) FoldersWithSelection() (model.FolderList, error)
func (Inbox) FollowerCount ¶
func (Inbox) Followers ¶
func (w Inbox) Followers() QueryBuilder[model.FollowerSummary]
func (Inbox) Following ¶
func (w Inbox) Following() QueryBuilder[model.FollowingSummary]
func (Inbox) FollowingByFolder ¶
func (w Inbox) FollowingByFolder(token string) ([]model.FollowingSummary, error)
func (Inbox) FollowingByToken ¶
func (Inbox) FollowingCount ¶
func (Inbox) HasRule ¶
HasRule returns a rule that matches the current user, rule type, and trigger. If no rule is found, then an empty rule is returned.
func (Inbox) Inbox ¶
func (w Inbox) Inbox() (QueryBuilder[model.Message], error)
Inbox returns a slice of messages in the current User's inbox
func (Inbox) IsInboxEmpty ¶
IsInboxEmpty returns TRUE if the inbox has no results and there are no filters applied This corresponds to there being NOTHING in the inbox, instead of just being filtered out.
func (Inbox) LikesBefore ¶
func (Inbox) Message ¶
Message uses the queryString ?messageId= parameter to load a Message from the database If the messageId parameter does not exist, is malformed, or if the message does not exist, then a new, empty Message is returned. In addition, if there is a "sibling" URL parameter (either "next" or "prev") then the next/previous message is loaded instead.
func (Inbox) NavigationID ¶
NavigationID returns the ID to use for highlighing navigation menus
func (Inbox) ProfileURL ¶
func (Inbox) RepliesAfter ¶
func (Inbox) RepliesBefore ¶
type Model ¶
type Model struct { Common // contains filtered or unexported fields }
Model builds objects from any model service that implements the ModelService interface
type Navigation ¶
type Navigation struct { // contains filtered or unexported fields }
Navigation is a builder for the admin/navigation page It can only be accessed by a Domain Owner
func NewNavigation ¶
func NewNavigation(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, stream *model.Stream, actionID string) (Navigation, error)
NewNavigation returns a fully initialized `Navigation` builder.
func (Navigation) BasePath ¶
func (w Navigation) BasePath() string
func (Navigation) NavigationID ¶
func (w Navigation) NavigationID() string
func (Navigation) PageTitle ¶
func (w Navigation) PageTitle() string
func (Navigation) Permalink ¶
func (w Navigation) Permalink() string
func (Navigation) Render ¶
func (w Navigation) Render() (template.HTML, error)
Render generates the string value for this Stream
func (Navigation) Token ¶
func (w Navigation) Token() string
type OAuthAuthorization ¶
type OAuthAuthorization struct {
// contains filtered or unexported fields
}
OAuthAuthorization is a lightweight builder that displays UI pages for an OAuth Application.
func NewOAuthAuthorization ¶
func NewOAuthAuthorization(factory Factory, request model.OAuthAuthorizationRequest) (OAuthAuthorization, error)
NewOAuthAuthorization returns a fully initialized/loaded `OAuthAuthorization` builder
func (OAuthAuthorization) ClientID ¶
func (r OAuthAuthorization) ClientID() string
func (OAuthAuthorization) Name ¶
func (r OAuthAuthorization) Name() string
func (OAuthAuthorization) RedirectURI ¶
func (r OAuthAuthorization) RedirectURI() string
func (OAuthAuthorization) ResponseType ¶
func (r OAuthAuthorization) ResponseType() string
func (OAuthAuthorization) Scope ¶
func (r OAuthAuthorization) Scope() string
func (OAuthAuthorization) Scopes ¶
func (r OAuthAuthorization) Scopes() []string
func (OAuthAuthorization) Website ¶
func (r OAuthAuthorization) Website() string
type Outbox ¶
type Outbox struct { Common // contains filtered or unexported fields }
Outbox builds individual messages from a User's Outbox.
func NewOutbox ¶
func NewOutbox(factory Factory, request *http.Request, response http.ResponseWriter, user *model.User, actionID string) (Outbox, error)
NewOutbox returns a fully initialized `Outbox` builder.
func (Outbox) ActivityPubAvatarURL ¶
func (Outbox) ActivityPubFollowersURL ¶
func (Outbox) ActivityPubFollowingURL ¶
func (Outbox) ActivityPubInboxURL ¶
func (Outbox) ActivityPubLikedURL ¶
func (Outbox) ActivityPubOutboxURL ¶
func (Outbox) ActivityPubPublicKeyURL ¶
func (Outbox) ActivityPubURL ¶
func (Outbox) DisplayName ¶
func (Outbox) FollowerCount ¶
func (Outbox) FollowingCount ¶
func (Outbox) IsMyself ¶
IsMyself returns TRUE if the outbox record is owned by the currently signed-in user
func (Outbox) Links ¶
func (w Outbox) Links() []model.PersonLink
func (Outbox) NavigationID ¶
NavigationID returns the ID to use for highlighing navigation menus
func (Outbox) Outbox ¶
func (w Outbox) Outbox() QueryBuilder[model.StreamSummary]
func (Outbox) ProfileURL ¶
func (Outbox) Replies ¶
func (w Outbox) Replies() QueryBuilder[model.StreamSummary]
func (Outbox) StatusMessage ¶
type Pipeline ¶
func (Pipeline) Execute ¶
func (pipeline Pipeline) Execute(factory Factory, builder Builder, buffer io.Writer, actionMethod ActionMethod) PipelineResult
Execute switches between GET and POST methods for this pipeline, based on the provided ActionMethod
type PipelineBehavior ¶
type PipelineBehavior func(*PipelineResult)
func Continue ¶
func Continue() PipelineBehavior
Continue is a NOOP that does not change the PipelineResult object
func UseResult ¶
func UseResult(newStatus PipelineResult) PipelineBehavior
UseResult takes a new PipelineResult object, and merges it into the existing PipelineResult object.
func (PipelineBehavior) AsFullPage ¶
func (exit PipelineBehavior) AsFullPage() PipelineBehavior
AsFullPage sets the FullPage flag on the PipelineResult object, which tells the builder to NOT include the header/footer from the site theme.
func (PipelineBehavior) RemoveEvent ¶
func (exit PipelineBehavior) RemoveEvent(name string) PipelineBehavior
RemoveEvent removes an HX-Trigger event to the PipelineResult object
func (PipelineBehavior) WithContentType ¶
func (exit PipelineBehavior) WithContentType(contentType string) PipelineBehavior
func (PipelineBehavior) WithError ¶
func (exit PipelineBehavior) WithError(err error) PipelineBehavior
WithError sets the Error value on the PipelineResult object
func (PipelineBehavior) WithEvent ¶
func (exit PipelineBehavior) WithEvent(name string, value string) PipelineBehavior
WithEvent adds an HX-Trigger event to the PipelineResult object
func (PipelineBehavior) WithHeader ¶
func (exit PipelineBehavior) WithHeader(name string, value string) PipelineBehavior
WithHeader adds an HX-Trigger event to the PipelineResult object
func (PipelineBehavior) WithStatusCode ¶
func (exit PipelineBehavior) WithStatusCode(statusCode int) PipelineBehavior
type PipelineHalter ¶
type PipelineResult ¶
type PipelineResult struct { StatusCode int // HTTP Status Code to be returned ContentType string // If present, then this option sets the content-type header Headers mapof.String // Map of header values to be applied to the response Events mapof.String // Map of events to trigger on the client (via HX-Trigger) FullPage bool // If true, then this result represents the entire page of content, and should not be wrapped in the global template Halt bool // If true, then this pipeline should halt execution Error error // If present, then there was an error building this page }
func NewPipelineResult ¶
func NewPipelineResult() PipelineResult
func (PipelineResult) Apply ¶
func (result PipelineResult) Apply(response http.ResponseWriter)
func (PipelineResult) GetContentType ¶
func (result PipelineResult) GetContentType() string
func (PipelineResult) GetStatusCode ¶
func (result PipelineResult) GetStatusCode() int
func (*PipelineResult) Merge ¶
func (result *PipelineResult) Merge(newStatus PipelineResult)
Merge combines two PipelineResult objects into one.
type QueryBuilder ¶
type QueryBuilder[T model.FieldLister] struct { Criteria exp.Expression SortField string SortDirection string MaxRows int64 // contains filtered or unexported fields }
func NewQueryBuilder ¶
func NewQueryBuilder[T model.FieldLister](service service.ModelService, criteria exp.Expression) QueryBuilder[T]
func (QueryBuilder[T]) All ¶
func (builder QueryBuilder[T]) All() QueryBuilder[T]
func (QueryBuilder[T]) By ¶
func (builder QueryBuilder[T]) By(sortField string) QueryBuilder[T]
func (QueryBuilder[T]) ByCreateDate ¶
func (builder QueryBuilder[T]) ByCreateDate() QueryBuilder[T]
func (QueryBuilder[T]) ByDisplayName ¶
func (builder QueryBuilder[T]) ByDisplayName() QueryBuilder[T]
func (QueryBuilder[T]) ByExpirationDate ¶
func (builder QueryBuilder[T]) ByExpirationDate() QueryBuilder[T]
func (QueryBuilder[T]) ByLabel ¶
func (builder QueryBuilder[T]) ByLabel() QueryBuilder[T]
func (QueryBuilder[T]) ByPublishDate ¶
func (builder QueryBuilder[T]) ByPublishDate() QueryBuilder[T]
func (QueryBuilder[T]) ByRank ¶
func (builder QueryBuilder[T]) ByRank() QueryBuilder[T]
func (QueryBuilder[T]) ByReadDate ¶
func (builder QueryBuilder[T]) ByReadDate() QueryBuilder[T]
func (QueryBuilder[T]) ByUpdateDate ¶
func (builder QueryBuilder[T]) ByUpdateDate() QueryBuilder[T]
func (QueryBuilder[T]) Reverse ¶
func (builder QueryBuilder[T]) Reverse() QueryBuilder[T]
func (QueryBuilder[T]) Top1 ¶
func (builder QueryBuilder[T]) Top1() QueryBuilder[T]
func (QueryBuilder[T]) Top12 ¶
func (builder QueryBuilder[T]) Top12() QueryBuilder[T]
func (QueryBuilder[T]) Top120 ¶
func (builder QueryBuilder[T]) Top120() QueryBuilder[T]
func (QueryBuilder[T]) Top30 ¶
func (builder QueryBuilder[T]) Top30() QueryBuilder[T]
func (QueryBuilder[T]) Top6 ¶
func (builder QueryBuilder[T]) Top6() QueryBuilder[T]
func (QueryBuilder[T]) Top60 ¶
func (builder QueryBuilder[T]) Top60() QueryBuilder[T]
func (QueryBuilder[T]) Top600 ¶
func (builder QueryBuilder[T]) Top600() QueryBuilder[T]
type Rule ¶
type Rule struct { Common // contains filtered or unexported fields }
Rule is a builder for the admin/rules page It can only be accessed by a Domain Owner
func NewRule ¶
func NewRule(factory Factory, request *http.Request, response http.ResponseWriter, rule *model.Rule, template model.Template, actionID string) (Rule, error)
NewRule returns a fully initialized `Rule` builder.
func (Rule) NavigationID ¶
func (Rule) ServerWideRules ¶
func (w Rule) ServerWideRules() *QueryBuilder[model.Rule]
type ServerFactory ¶
type StateSetter ¶
type StateSetter interface {
// contains filtered or unexported methods
}
type Step ¶
type Step interface { Get(Builder, io.Writer) PipelineBehavior Post(Builder, io.Writer) PipelineBehavior }
func ExecutableStep ¶
ExecutableStep uses an Step object to create a new action
type StepAddModelObject ¶
StepAddModelObject is an action that can add new model objects of any type
func (StepAddModelObject) Get ¶
func (step StepAddModelObject) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a modal form that lets users enter data for their new model object.
func (StepAddModelObject) Post ¶
func (step StepAddModelObject) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post initializes a new model object, populates it with data from the form, then saves it to the database.
type StepAddStream ¶
type StepAddStream struct { Style string // Style of input widget to use. Options are: "chooser" and "inline". Defaults to "chooser". Title string // Title to use on the create modal. Defaults to "Add a Stream" Location string // Options are: "top", "child", "outbox". Defaults to "child". TemplateID string // ID of the template to use. If empty, then template roles are used. TemplateRoles []string // List of acceptable Template Roles that can be used to make a stream. If empty, then all template for this container are valid. WithData map[string]*template.Template // Map of values to preset in the new stream }
func (StepAddStream) Get ¶
func (step StepAddStream) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get builds the HTML for this step - either a modal template selector, or the embedded edit form
func (StepAddStream) Post ¶
func (step StepAddStream) Post(builder Builder, buffer io.Writer) PipelineBehavior
type StepAsConfirmation ¶
StepAsConfirmation displays a confirmation dialog on GET, giving users an option to continue or not
func (StepAsConfirmation) Get ¶
func (step StepAsConfirmation) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a modal that asks users to continue or not.
func (StepAsConfirmation) Post ¶
func (step StepAsConfirmation) Post(builder Builder, _ io.Writer) PipelineBehavior
Post does nothing. (Other steps in the pipeline will make changes)
type StepAsModal ¶
StepAsModal represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepAsModal) Get ¶
func (step StepAsModal) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a form where users can update stream data
func (StepAsModal) Post ¶
func (step StepAsModal) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepAsTooltip ¶
StepAsTooltip represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepAsTooltip) Get ¶
func (step StepAsTooltip) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a form where users can update stream data
func (StepAsTooltip) Post ¶
func (step StepAsTooltip) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
func (StepAsTooltip) UseGlobalWrapper ¶
func (step StepAsTooltip) UseGlobalWrapper() bool
type StepDelete ¶
StepDelete represents an action-step that can delete a Stream from the Domain
func (StepDelete) Get ¶
func (step StepDelete) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a customizable confirmation form for the delete
func (StepDelete) Post ¶
func (step StepDelete) Post(builder Builder, _ io.Writer) PipelineBehavior
Post removes the object from the database (likely using a soft-delete, though)
type StepDeleteAttachments ¶
type StepDeleteAttachments struct {
All bool
}
StepDeleteAttachments represents an action that can upload attachments. It can only be used on a StreamBuilder
func (StepDeleteAttachments) Get ¶
func (step StepDeleteAttachments) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepDeleteAttachments) Post ¶
func (step StepDeleteAttachments) Post(builder Builder, _ io.Writer) PipelineBehavior
type StepDo ¶
type StepDo struct {
Action string
}
StepDo represents an action-step that sends an HTMX 'forward' to a new page.
type StepEditConnection ¶
type StepEditConnection struct{}
func (StepEditConnection) Get ¶
func (step StepEditConnection) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepEditConnection) Post ¶
func (step StepEditConnection) Post(builder Builder, _ io.Writer) PipelineBehavior
type StepEditContent ¶
StepEditContent represents an action-step that can edit/update Container in a streamDraft.
func (StepEditContent) Get ¶
func (step StepEditContent) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepEditContent) Post ¶
func (step StepEditContent) Post(builder Builder, _ io.Writer) PipelineBehavior
type StepEditModelObject ¶
StepEditModelObject is an action that can add new sub-streams to the domain.
func (StepEditModelObject) Get ¶
func (step StepEditModelObject) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a modal form that lets users enter data for their new model object.
func (StepEditModelObject) Post ¶
func (step StepEditModelObject) Post(builder Builder, _ io.Writer) PipelineBehavior
Post initializes a new model object, populates it with data from the form, then saves it to the database.
type StepEditWidget ¶
type StepEditWidget struct{}
StepEditWidget represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepEditWidget) Get ¶
func (step StepEditWidget) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepEditWidget) Post ¶
func (step StepEditWidget) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepError ¶
type StepForwardTo ¶
StepForwardTo represents an action-step that sends an HTMX 'forward' to a new page.
func (StepForwardTo) Get ¶
func (step StepForwardTo) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepForwardTo) Post ¶
func (step StepForwardTo) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepHalt ¶
type StepHalt struct{}
StepHalt represents an action-step that can save changes to any object
type StepIfCondition ¶
StepIfCondition represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepIfCondition) Get ¶
func (step StepIfCondition) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a form where users can update stream data
func (StepIfCondition) Post ¶
func (step StepIfCondition) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepInlineError ¶
StepInlineError represents an action-step that can build a Stream into HTML
func (StepInlineError) Get ¶
func (step StepInlineError) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get builds the Stream HTML to the context
func (StepInlineError) Post ¶
func (step StepInlineError) Post(builder Builder, buffer io.Writer) PipelineBehavior
type StepInlineSuccess ¶
StepInlineSuccess represents an action-step that can build a Stream into HTML
func (StepInlineSuccess) Get ¶
func (step StepInlineSuccess) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get builds the Stream HTML to the context
func (StepInlineSuccess) Post ¶
func (step StepInlineSuccess) Post(builder Builder, buffer io.Writer) PipelineBehavior
type StepProcessContent ¶
StepProcessContent is an action step that adds tags to a stream, either by scanning the content, or by calculating template values
func (StepProcessContent) Get ¶
func (step StepProcessContent) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get builds the HTML for this step - either a modal template selector, or the embedded edit form
func (StepProcessContent) Post ¶
func (step StepProcessContent) Post(builder Builder, buffer io.Writer) PipelineBehavior
type StepPublish ¶
type StepPublish struct{}
StepPublish represents an action-step that can update a stream's PublishDate with the current time.
func (StepPublish) Get ¶
func (step StepPublish) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepPublish) Post ¶
func (step StepPublish) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with the current date as the "PublishDate"
type StepRedirectTo ¶
StepRedirectTo represents an action-step that sends an HTTP redirect to another page.
func (StepRedirectTo) Get ¶
func (step StepRedirectTo) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepRedirectTo) Post ¶
func (step StepRedirectTo) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepRefreshPage ¶
type StepRefreshPage struct{}
StepRefreshPage represents an action-step that forwards the user to a new page.
func (StepRefreshPage) Get ¶
func (step StepRefreshPage) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepRefreshPage) Post ¶
func (step StepRefreshPage) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepReloadPage ¶
type StepReloadPage struct{}
StepReloadPage represents an action-step that forwards the user to a new page.
func (StepReloadPage) Get ¶
func (step StepReloadPage) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepReloadPage) Post ¶
func (step StepReloadPage) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepRemoveEvent ¶
type StepRemoveEvent struct {
Event string
}
StepRemoveEvent represents an action-step that forwards the user to a new page.
func (StepRemoveEvent) Get ¶
func (step StepRemoveEvent) Get(_ Builder, _ io.Writer) PipelineBehavior
func (StepRemoveEvent) Post ¶
func (step StepRemoveEvent) Post(_ Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepSendEmail ¶
type StepSendEmail struct {
Email string
}
StepSendEmail represents an action-step that can send a named email to a recipient
func (StepSendEmail) Get ¶
func (step StepSendEmail) Get(_ Builder, _ io.Writer) PipelineBehavior
func (StepSendEmail) Post ¶
func (step StepSendEmail) Post(builder Builder, _ io.Writer) PipelineBehavior
Post saves the object to the database
type StepServerRedirect ¶
StepServerRedirect represents an action-step that continues building the output stream as a GET request to a new action.
func (StepServerRedirect) Get ¶
func (step StepServerRedirect) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepServerRedirect) Post ¶
func (step StepServerRedirect) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepSetData ¶
type StepSetData struct { FromURL []string // List of paths to pull from URL data FromForm []string // List of paths to pull from Form data Values map[string]*template.Template // values to set directly into the object Defaults mapof.Any // values to set into the object IFF they are currently empty. }
StepSetData represents an action-step that can update the custom data stored in a Stream
func (StepSetData) Get ¶
func (step StepSetData) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepSetData) Post ¶
func (step StepSetData) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepSetHeader ¶
StepSetHeader represents an action-step that can update the custom data stored in a Stream
func (StepSetHeader) Get ¶
func (step StepSetHeader) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepSetHeader) Post ¶
func (step StepSetHeader) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepSetQueryParam ¶
StepSetQueryParam represents an action-step that sets values to the request query string
func (StepSetQueryParam) Do ¶
func (step StepSetQueryParam) Do(builder Builder) PipelineBehavior
func (StepSetQueryParam) Get ¶
func (step StepSetQueryParam) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a form where users can update stream data
func (StepSetQueryParam) Post ¶
func (step StepSetQueryParam) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepSetRenderData ¶
StepSetRenderData represents an action-step that sets values to the request query string
func (StepSetRenderData) Do ¶
func (step StepSetRenderData) Do(builder Builder) PipelineBehavior
func (StepSetRenderData) Get ¶
func (step StepSetRenderData) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a form where users can update stream data
func (StepSetRenderData) Post ¶
func (step StepSetRenderData) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepSetResponse ¶
type StepSetResponse struct{}
func (StepSetResponse) Get ¶
func (step StepSetResponse) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepSetResponse) Post ¶
func (step StepSetResponse) Post(builder Builder, _ io.Writer) PipelineBehavior
type StepSetResponseTransaction ¶
type StepSetResponseTransaction struct { URL string `json:"url" form:"url"` // The URL of the object being responded to Type string `json:"type" form:"type"` // The Response.Type (Like, Dislike, etc) Content string `json:"content" form:"content"` // Addional Value (for Emoji, etc) Exists string `json:"exists" form:"exists"` // If TRUE, then create/update the response. If FALSE, remove it. }
type StepSetSimpleSharing ¶
StepSetSimpleSharing represents an action that can edit a top-level folder in the Domain
func (StepSetSimpleSharing) Get ¶
func (step StepSetSimpleSharing) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepSetSimpleSharing) Post ¶
func (step StepSetSimpleSharing) Post(builder Builder, _ io.Writer) PipelineBehavior
type StepSetState ¶
type StepSetState struct {
State string
}
StepSetState represents an action-step that can change a Stream's state
func (StepSetState) Get ¶
func (step StepSetState) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepSetState) Post ¶
func (step StepSetState) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with configured data, and moves the stream to a new state
type StepSetThumbnail ¶
type StepSetThumbnail struct {
Path string
}
StepSetThumbnail represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepSetThumbnail) Get ¶
func (step StepSetThumbnail) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepSetThumbnail) Post ¶
func (step StepSetThumbnail) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepSortAttachments ¶
StepSortAttachments represents an action-step that can update multiple records at once
func (StepSortAttachments) Get ¶
func (step StepSortAttachments) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepSortAttachments) Post ¶
func (step StepSortAttachments) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepSortWidgets ¶
type StepSortWidgets struct{}
StepSortWidgets represents an action-step that can edit/update Container in a streamDraft.
func (StepSortWidgets) Get ¶
func (step StepSortWidgets) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepSortWidgets) Post ¶
func (step StepSortWidgets) Post(builder Builder, _ io.Writer) PipelineBehavior
type StepStreamPromoteDraft ¶
type StepStreamPromoteDraft struct {
StateID string
}
StepStreamPromoteDraft represents an action-step that can copy the Container from a StreamDraft into its corresponding Stream
func (StepStreamPromoteDraft) Get ¶
func (step StepStreamPromoteDraft) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepStreamPromoteDraft) Post ¶
func (step StepStreamPromoteDraft) Post(builder Builder, _ io.Writer) PipelineBehavior
Post copies relevant information from the draft into the primary stream, then deletes the draft
type StepTableEditor ¶
func (StepTableEditor) Get ¶
func (step StepTableEditor) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepTableEditor) Post ¶
func (step StepTableEditor) Post(builder Builder, _ io.Writer) PipelineBehavior
type StepTriggerEvent ¶
StepTriggerEvent represents an action-step that forwards the user to a new page.
func (StepTriggerEvent) Get ¶
func (step StepTriggerEvent) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepTriggerEvent) Post ¶
func (step StepTriggerEvent) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepUnPublish ¶
type StepUnPublish struct {
Role string
}
StepUnPublish represents an action-step that can update a stream's PublishDate with the current time.
func (StepUnPublish) Get ¶
func (step StepUnPublish) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepUnPublish) Post ¶
func (step StepUnPublish) Post(builder Builder, _ io.Writer) PipelineBehavior
Post updates the stream with the current date as the "PublishDate"
type StepUploadAttachment ¶
type StepUploadAttachment struct {
Maximum int
}
StepUploadAttachment represents an action that can upload attachments. It can only be used on a StreamBuilder
func (StepUploadAttachment) Get ¶
func (step StepUploadAttachment) Get(builder Builder, _ io.Writer) PipelineBehavior
func (StepUploadAttachment) Post ¶
func (step StepUploadAttachment) Post(builder Builder, buffer io.Writer) PipelineBehavior
type StepViewFeed ¶
type StepViewFeed struct{}
StepViewFeed represents an action-step that can build a Stream into HTML
func (StepViewFeed) Get ¶
func (step StepViewFeed) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get builds the Stream HTML to the context
func (StepViewFeed) Post ¶
func (step StepViewFeed) Post(builder Builder, _ io.Writer) PipelineBehavior
type StepViewHTML ¶
StepViewHTML represents an action-step that can build a Stream into HTML
func (StepViewHTML) Get ¶
func (step StepViewHTML) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get builds the Stream HTML to the context
func (StepViewHTML) Post ¶
func (step StepViewHTML) Post(builder Builder, buffer io.Writer) PipelineBehavior
type StepViewJSONLD ¶
type StepViewJSONLD struct {
Method string
}
StepViewJSONLD represents an action-step that can build a Stream into HTML
func (StepViewJSONLD) Get ¶
func (step StepViewJSONLD) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get builds the Stream HTML to the context
func (StepViewJSONLD) Post ¶
func (step StepViewJSONLD) Post(builder Builder, buffer io.Writer) PipelineBehavior
type StepWebSub ¶
type StepWebSub struct { }
StepWebSub represents an action-step that can build a Stream into HTML
func (StepWebSub) Get ¶
func (step StepWebSub) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get is not required by WebSub. So let's redirect to the primary action.
func (StepWebSub) Post ¶
func (step StepWebSub) Post(builder Builder, _ io.Writer) PipelineBehavior
Post accepts a WebSub request, verifies it, and potentially creates a new Follower record.
type StepWithChildren ¶
StepWithChildren represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithChildren) Get ¶
func (step StepWithChildren) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithChildren) Post ¶
func (step StepWithChildren) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepWithDraft ¶
StepWithDraft represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithDraft) Get ¶
func (step StepWithDraft) Get(builder Builder, buffer io.Writer) PipelineBehavior
Get displays a form where users can update stream data
func (StepWithDraft) Post ¶
func (step StepWithDraft) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepWithFolder ¶
StepWithFolder represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithFolder) Get ¶
func (step StepWithFolder) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithFolder) Post ¶
func (step StepWithFolder) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepWithFollower ¶
StepWithFollower represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithFollower) Get ¶
func (step StepWithFollower) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithFollower) Post ¶
func (step StepWithFollower) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepWithFollowing ¶
StepWithFollowing represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithFollowing) Get ¶
func (step StepWithFollowing) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithFollowing) Post ¶
func (step StepWithFollowing) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepWithMessage ¶
StepWithMessage is an action-step that executes a new pipeline on an Inbox Message, identified by the query parameter "messageId"
func (StepWithMessage) Get ¶
func (step StepWithMessage) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithMessage) Post ¶
func (step StepWithMessage) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the message with data from the request body.
type StepWithNextSibling ¶
StepWithNextSibling represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithNextSibling) Get ¶
func (step StepWithNextSibling) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithNextSibling) Post ¶
func (step StepWithNextSibling) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post executes the subSteps on the parent Stream
type StepWithParent ¶
StepWithParent represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithParent) Get ¶
func (step StepWithParent) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithParent) Post ¶
func (step StepWithParent) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post executes the subSteps on the parent Stream
type StepWithPrevSibling ¶
StepWithPrevSibling represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithPrevSibling) Get ¶
func (step StepWithPrevSibling) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithPrevSibling) Post ¶
func (step StepWithPrevSibling) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post executes the subSteps on the parent Stream
type StepWithResponse ¶
StepWithResponse represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithResponse) Get ¶
func (step StepWithResponse) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithResponse) Post ¶
func (step StepWithResponse) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type StepWithRule ¶
StepWithRule represents an action-step that can update the data.DataMap custom data stored in a Stream
func (StepWithRule) Get ¶
func (step StepWithRule) Get(builder Builder, buffer io.Writer) PipelineBehavior
func (StepWithRule) Post ¶
func (step StepWithRule) Post(builder Builder, buffer io.Writer) PipelineBehavior
Post updates the stream with approved data from the request body.
type Stream ¶
type Stream struct { Common // contains filtered or unexported fields }
Stream wraps a model.Stream object and provides functions that make it easy to build an HTML template with it.
func NewStream ¶
func NewStream(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, stream *model.Stream, actionID string) (Stream, error)
NewStream creates a new object that can generate HTML for a specific stream/view
func NewStreamFromURI ¶
func NewStreamFromURI(serverFactory ServerFactory, request *http.Request, response http.ResponseWriter, stream *model.Stream, actionID string) (Stream, error)
NewStreamFromURI creates a new Stream builder for the provided request context. IMPORTANT: The stream parameter is expected to be an empty stream in the caller's scope that will be populated by this function.
func NewStreamWithoutTemplate ¶
func NewStreamWithoutTemplate(factory Factory, request *http.Request, response http.ResponseWriter, stream *model.Stream, actionID string) (Stream, error)
NewStreamWithoutTemplate creates a new object that can generate HTML for a specific stream/view
func (Stream) Ancestors ¶
func (w Stream) Ancestors() QueryBuilder[model.StreamSummary]
Ancestors returns all Streams that have the same "parent" as the current Stream's parent
func (Stream) AnnouncesBefore ¶
func (Stream) Attachment ¶
func (w Stream) Attachment() (model.Attachment, error)
Reference to the first file attached to this stream
func (Stream) Attachments ¶
func (w Stream) Attachments() ([]model.Attachment, error)
Attachments lists all attachments for this stream.
func (Stream) AttributedTo ¶
func (w Stream) AttributedTo() model.PersonLink
AttributedTo returns ALL AttributedTo records for this stream
func (Stream) Author ¶
func (w Stream) Author() model.PersonLink
Author returns the "first" AttributedTo record for this stream
func (Stream) Breadcrumbs ¶
func (w Stream) Breadcrumbs() ([]model.StreamSummary, error)
func (Stream) CanCreate ¶
func (w Stream) CanCreate() []form.LookupCode
CanCreate returns all of the templates that can be created underneath the current stream.
func (Stream) Children ¶
func (w Stream) Children() QueryBuilder[model.StreamSummary]
Children returns all Streams with a "parent" is the current Stream
func (Stream) ContentHTML ¶
Returns the body content as an HTML template
func (Stream) ContentRaw ¶
func (Stream) CreateDate ¶
CreateDate returns the CreateDate of the stream being builded
func (Stream) Document ¶
func (w Stream) Document() model.DocumentLink
Document returns the DocumentLink record for this stream
func (Stream) FirstChild ¶
FirstChild returns the first child Stream underneath this one, based on the provided sort field
func (Stream) InReplyTo ¶
InReplyTo returns an ActivityStream reference to the URL that this stream replies to
func (Stream) IsCurrentStream ¶
func (Stream) IsReply ¶
IsReply returns TRUE if this stream is marked as a reply to another stream or resource
func (Stream) LastChild ¶
FirstChild returns the first child Stream underneath this one, based on the provided sort field
func (Stream) LikesBefore ¶
func (Stream) ListAllWidgets ¶
func (w Stream) ListAllWidgets() []form.LookupCode
ListAllWidgets returns a list of all the widgets available on this server
func (Stream) ListWidgetsByLocation ¶
func (w Stream) ListWidgetsByLocation(location string) []model.StreamWidget
ListWidgetsByLocation returns a list of all the widgets in the specified location
func (Stream) NavigationID ¶
NavigationID returns the unique ID of the top-level stream in this stream's hierarchy
func (Stream) NextSibling ¶
NextSibling returns the sibling Stream that immediately follows this one, based on the provided sort field
func (Stream) PrevSibling ¶
PrevSibling returns the sibling Stream that immediately preceeds this one, based on the provided sort field
func (Stream) PublishDate ¶
PublishDate returns the PublishDate of the stream being builded
func (Stream) RepliesAfter ¶
func (Stream) RepliesBefore ¶
RepliesBefore returns a slice of all ActivityStreams before the specified date
func (Stream) ShortSummary ¶
SummarySummary returns a plaintext summary (<200 characters) of the stream's description
func (Stream) Siblings ¶
func (w Stream) Siblings() QueryBuilder[model.StreamSummary]
Siblings returns all Streams that have the same "parent" as the current Stream
func (Stream) SummaryHTML ¶
SummaryHTML returns the description of the stream being builded
func (Stream) TemplateID ¶
TemplateID returns the name of the template being used
func (Stream) UpdateDate ¶
UpdateDate returns the UpdateDate of the stream being builded
func (Stream) UserCan ¶
UserCan returns TRUE if this Request is authorized to access the requested view
type TemplateLike ¶
type User ¶
type User struct { Common // contains filtered or unexported fields }
User is a builder for the admin/users page It can only be accessed by a Domain Owner
func NewUser ¶
func NewUser(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, user *model.User, actionID string) (User, error)
NewUser returns a fully initialized `User` builder.
func (User) AssignedGroups ¶
AssignedGroups lists all groups to which the current user is assigned.
func (User) DisplayName ¶
func (User) NavigationID ¶
func (User) SignupForm ¶
func (w User) SignupForm() model.SignupForm
func (User) Users ¶
func (w User) Users() *QueryBuilder[model.UserSummary]
type Widget ¶
type Widget struct { Widget model.StreamWidget *Stream }
Widget builder is created by the "with-widget" action, and can execute additional action steps on a widget that is embedded in a stream. To save the final result, you must call "save" on the stream itself, not within this widget.
Source Files ¶
- build.go
- builder_.go
- builder_admin_block.go
- builder_admin_domain.go
- builder_admin_groups.go
- builder_admin_navigation.go
- builder_admin_users.go
- builder_common.go
- builder_inbox.go
- builder_model.go
- builder_oAuthAuthorization.go
- builder_outbox.go
- builder_stream.go
- builder_widget.go
- constants.go
- factory.go
- functions.go
- interfaces.go
- pipeline.go
- pipeline_behavior.go
- pipeline_result.go
- queryBuilder.go
- step_.go
- step_AddModelObject.go
- step_AddStream.go
- step_AsConfirmation.go
- step_AsModal.go
- step_AsTooltip.go
- step_Delete.go
- step_DeleteAttachments.go
- step_EditConnection.go
- step_EditContent.go
- step_EditModelObject.go
- step_EditTable.go
- step_EditWidget.go
- step_Error.go
- step_ForwardTo.go
- step_Halt.go
- step_IfCondition.go
- step_InlineError.go
- step_InlineSuccess.go
- step_ProcessContent.go
- step_PromoteDraft.go
- step_Publish.go
- step_RedirectTo.go
- step_RefreshPage.go
- step_ReloadPage.go
- step_RemoveEvent.go
- step_Save.go
- step_SendEmail.go
- step_ServerRedirect.go
- step_SetData.go
- step_SetHeader.go
- step_SetQueryParam.go
- step_SetRenderData.go
- step_SetResponse.go
- step_SetSimpleSharing.go
- step_SetState.go
- step_SetThumbnail.go
- step_Sort.go
- step_SortAttachments.go
- step_SortWidgets.go
- step_TriggerEvent.go
- step_UnPublish.go
- step_UploadAttachment.go
- step_ViewFeed.go
- step_ViewHTML.go
- step_ViewJSONLD.go
- step_WebSub.go
- step_WithChildren.go
- step_WithDraft.go
- step_WithFolder.go
- step_WithFollower.go
- step_WithFollowing.go
- step_WithMessage.go
- step_WithNextSibling.go
- step_WithParent.go
- step_WithPrevSibling.go
- step_WithResponse.go
- step_WithRule.go
- step_do.go
- utilities.go