build

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 26, 2025 License: AGPL-3.0 Imports: 62 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsHTML

func AsHTML(factory Factory, ctx echo.Context, b Builder, actionMethod ActionMethod) error

AsHTML collects the logic to build complete vs. partial HTML pages.

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 FuncMap

func FuncMap(icons icon.Provider) template.FuncMap

func RefreshPage

func RefreshPage(ctx echo.Context)

func TriggerEvent

func TriggerEvent(ctx echo.Context, event string)

func WrapForm

func WrapForm(endpoint string, content string, encoding string, options ...string) 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 WrapModalForm(response http.ResponseWriter, endpoint string, content string, encoding string, options ...string) string

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 Attachment

type Attachment struct {
	CommonWithTemplate
	// contains filtered or unexported fields
}

Attachment builds objects from any model service that implements the ModelService interface

func NewAttachment

func NewAttachment(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, attachment *model.Attachment, actionID string) (Attachment, error)

NewAttachment returns a fully initialized `Attachment` builder.

func (Attachment) AmFollowing

func (w Attachment) AmFollowing(url string) model.Following

AmFollowing returns a Following record for the current user and the given URL If the user is not authenticated, or the URL is not valid, then an empty Following record is returned. The UX uses this to label "mutual" follows

func (Attachment) AttachmentID

func (w Attachment) AttachmentID() string

AttachmentID returns the AttachmentID property of this Follow

func (Attachment) BasePath

func (w Attachment) BasePath() string

func (Attachment) Category

func (w Attachment) Category() string

func (Attachment) CreateDate

func (w Attachment) CreateDate() int64

CreateDate returns the CreateDate property of this Follow

func (Attachment) Description

func (w Attachment) Description() string

func (Attachment) Duration

func (w Attachment) Duration() int

func (Attachment) Height

func (w Attachment) Height() int

func (Attachment) Label

func (w Attachment) Label() string

func (Attachment) ObjectID

func (w Attachment) ObjectID() string

ObjectID returns the ObjectID property of this Follow

func (Attachment) ObjectType

func (w Attachment) ObjectType() string

ObjectType returns the ObjectType property of this Follow

func (Attachment) Original

func (w Attachment) Original() string

func (Attachment) PageTitle

func (w Attachment) PageTitle() string
func (w Attachment) Permalink() string

func (Attachment) Rank

func (w Attachment) Rank() int

func (Attachment) Render

func (w Attachment) Render() (template.HTML, error)

func (Attachment) Rules

func (w Attachment) Rules() model.AttachmentRules

func (Attachment) Status

func (w Attachment) Status() string

func (Attachment) Token

func (w Attachment) Token() string

func (Attachment) URL

func (w Attachment) URL() string

func (Attachment) UpdateDate

func (w Attachment) UpdateDate() int64

UpdateDate returns the UpdateDate property of this Follow

func (Attachment) UserCan

func (w Attachment) UserCan(string) bool

func (Attachment) View

func (w Attachment) View(actionID string) (template.HTML, error)

View executes a separate view for this Stream

func (Attachment) Width

func (w Attachment) Width() int

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 built
	NavigationID() string                // ID of the Top-Level item to highlight in the navigation.
	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 built
	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
	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 NewCommon

func NewCommon(factory Factory, request *http.Request, response http.ResponseWriter) Common

func (Common) ActivityStream

func (w Common) ActivityStream(url string) streams.Document

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

func (w Common) ActivityStreamActor(url string) streams.Document

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) AllowedSearchTags

func (w Common) AllowedSearchTags() *QueryBuilder[model.SearchTag]

AllowedSearchTags returns a query builder for all SearchTags that are marked "Allowed" by the domain admin.

func (Common) AuthenticatedID

func (w Common) AuthenticatedID() primitive.ObjectID

AuthenticatedID returns the unique ID of the currently logged in user (may be nil).

func (Common) Dataset

func (w Common) Dataset(name string) form.LookupGroup

Dataset returns a single form.LookupGroup from the LookupProvider

func (Common) DatasetValue

func (w Common) DatasetValue(name string, value string) form.LookupCode

DatasetValue returns a single form.LookupCode from the LookupProvider

func (Common) DomainHasRegistrationForm

func (w Common) DomainHasRegistrationForm() (bool, error)

func (Common) DomainLabel

func (w Common) DomainLabel() (string, error)

func (Common) FeaturedSearchTags

func (w Common) FeaturedSearchTags() *QueryBuilder[model.SearchTag]

func (Common) GetBool

func (w Common) GetBool(name string) bool

func (Common) GetContent

func (w Common) GetContent() template.HTML

func (Common) GetFloat

func (w Common) GetFloat(name string) float64

func (Common) GetFollowingID

func (w Common) GetFollowingID(url string) string

IsFollowing returns TRUE if the curren user is following the document at a specific URI (or the actor who created the document)

func (Common) GetHTML

func (w Common) GetHTML(name string) template.HTML

func (Common) GetInt

func (w Common) GetInt(name string) int

func (Common) GetInt64

func (w Common) GetInt64(name string) int64

func (Common) GetResponseID

func (w Common) GetResponseID(responseType string, url string) string

func (Common) GetResponseSummary

func (w Common) GetResponseSummary(url string) model.UserResponseSummary

func (Common) GetString

func (w Common) GetString(name string) string

func (Common) Host

func (w Common) Host() string

Host returns the protocol + the Hostname

func (Common) Hostname

func (w Common) Hostname() string

Hostname returns the configured hostname for this request

func (Common) IsAuthenticated

func (w Common) IsAuthenticated() bool

IsAuthenticated returns TRUE if the user is signed in

func (Common) IsMe

func (w Common) IsMe(url string) bool

IsMe returns TRUE if the provided URI is the profileURL of the current user

func (Common) IsOwner

func (w Common) IsOwner() bool

IsOwner returns TRUE if the user is a Domain Owner

func (Common) IsPartialRequest

func (w Common) IsPartialRequest() bool

IsPartialRequest returns TRUE if this is a partial page request from htmx.

func (Common) Method

func (w Common) Method() string

Returns the request method

func (Common) Navigation

func (w Common) Navigation() (sliceof.Object[model.StreamSummary], error)

Navigation returns an array of Streams that have a Zero ParentID

func (Common) NavigationID

func (w Common) NavigationID() string

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

func (w Common) NotMe(url string) bool

NotMe returns TRUE if the provided URI is NOT the ProfileURL of the current user

func (Common) Now

func (w Common) Now() int64

Now returns the current time in milliseconds since the Unix epoch

func (Common) PageTitle

func (w Common) PageTitle() string

func (Common) Path

func (w Common) Path() string

Path returns the HTTP Request path

func (Common) PathList

func (w Common) PathList() list.List

PathList returns the HTTP Request path as a List of strings

func (Common) Protocol

func (w Common) Protocol() string

Protocol returns http:// or https:// used for this request

func (Common) QueryParam

func (w Common) QueryParam(param string) string

Returns the designated request parameter. If there are multiple values for the parameter, then only the first value is returned.

func (Common) QueryString

func (w Common) QueryString() template.URL

QueryString returns the raw query string (encoded as a template.URL) to be re-embedded in a template link.

func (Common) Search

func (w Common) Search() SearchBuilder

func (Common) SearchTag

func (w Common) SearchTag(tagName string) model.SearchTag

func (Common) SetContent

func (w Common) SetContent(value string)

func (Common) SetQueryParam

func (w Common) SetQueryParam(name string, value string)

SetQueryParam updates the HTTP request, setting a new value for an individual query parameter.

func (Common) Summary

func (w Common) Summary() string

func (Common) URL

func (w Common) URL() string

URL returns the originally requested URL

func (Common) UserCan

func (w Common) UserCan(_ string) bool

UserCan returns TRUE if the current user has the specified permission. Default implementation returns FALSE for all requests.

func (Common) UserImage

func (w Common) UserImage() (string, error)

UserAvatar returns the avatar image of the user

func (Common) UserName

func (w Common) UserName() (string, error)

UserName returns the DisplayName of the user

type CommonWithTemplate

type CommonWithTemplate struct {
	Common
	// contains filtered or unexported fields
}

func NewCommonWithTemplate

func NewCommonWithTemplate(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, actionID string) (CommonWithTemplate, error)

type DocumentLinker

type DocumentLinker interface {
	DocumentLink() model.DocumentLink
}

type Domain

type Domain struct {
	CommonWithTemplate
	// 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) AllConnections

func (w Domain) AllConnections() mapof.Object[model.Connection]

Connection loads an external service connection from the database

func (Domain) BasePath

func (w Domain) BasePath() string

func (Domain) NavigationID

func (w Domain) NavigationID() string

func (Domain) PageTitle

func (w Domain) PageTitle() string
func (w Domain) Permalink() string

func (Domain) PropertyForm

func (w Domain) PropertyForm() form.Element

PropertyForm returns the custom property form for this Domain, defined by the Theme that it uses.

func (Domain) Provider

func (w Domain) Provider(providerID string) providers.Provider

func (Domain) Providers

func (w Domain) Providers() []form.LookupCode

Providers lists all available external services that can be connected to this domain

func (Domain) RegistrationTemplate

func (w Domain) RegistrationTemplate() model.Registration

RegistrationTemplate returns the signup template selected for this domain

func (Domain) RegistrationTemplates

func (w Domain) RegistrationTemplates() []form.LookupCode

RegistrationTemplates returns all available signup templates

func (Domain) Render

func (w Domain) Render() (template.HTML, error)

Render generates the string value for this Stream

func (Domain) Theme

func (w Domain) Theme(themeID string) model.Theme

func (Domain) ThemeID

func (w Domain) ThemeID() string

func (Domain) Themes

func (w Domain) Themes() []model.Theme

func (Domain) Token

func (w Domain) Token() string

func (Domain) View

func (w Domain) View(actionID string) (template.HTML, error)

View executes a separate view for this Group

type Factory

type Factory interface {
	// Model Services
	Model(string) (service.ModelService, error)
	ActivityStream() *service.ActivityStream
	Attachment() *service.Attachment
	Connection() *service.Connection
	Folder() *service.Folder
	Following() *service.Following
	Follower() *service.Follower
	Group() *service.Group
	Inbox() *service.Inbox
	Mention() *service.Mention
	Outbox() *service.Outbox
	Provider() *service.Provider
	Registration() *service.Registration
	Response() *service.Response
	Rule() *service.Rule
	Search() *service.Search
	SearchTag() *service.SearchTag
	Stream() *service.Stream
	StreamArchive() *service.StreamArchive
	StreamDraft() *service.StreamDraft
	Template() *service.Template
	Theme() *service.Theme
	User() *service.User
	Webhook() *service.Webhook
	Widget() *service.Widget

	// Other data services
	Config() config.Domain
	Content() *service.Content
	Domain() *service.Domain
	Email() *service.DomainEmail
	Host() string
	Hostname() string
	HTTPCache() *httpcache.HTTPCache
	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 primitive.ObjectID
}

Factory is used to locate all necessary services

type Follower

type Follower struct {
	CommonWithTemplate
	// contains filtered or unexported fields
}

Follower builds objects from any model service that implements the ModelService interface

func NewFollower

func NewFollower(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, follower *model.Follower, actionID string) (Follower, error)

NewFollower returns a fully initialized `Follower` builder.

func (Follower) Actor

func (w Follower) Actor() model.PersonLink

ActorID returns the ActorID property of this Follow

func (Follower) AmFollowing

func (w Follower) AmFollowing(url string) model.Following

AmFollowing returns a Following record for the current user and the given URL If the user is not authenticated, or the URL is not valid, then an empty Following record is returned. The UX uses this to label "mutual" follows

func (Follower) BasePath

func (w Follower) BasePath() string

func (Follower) CreateDate

func (w Follower) CreateDate() int64

CreateDate returns the CreateDate property of this Follow

func (Follower) Data

func (w Follower) Data(value string) any

Data returns a single data value from this Follow

func (Follower) ExpireDate

func (w Follower) ExpireDate() int64

ExpireDate returns the ExpireDate property of this Follow

func (Follower) FollowerID

func (w Follower) FollowerID() primitive.ObjectID

FollowerID returns the FollowerID property of this Follow

func (Follower) Format

func (w Follower) Format() string

Format returns the Format property of this Follow

func (Follower) Label

func (w Follower) Label() string

func (Follower) Method

func (w Follower) Method() string

Method returns the Method property of this Follow

func (Follower) PageTitle

func (w Follower) PageTitle() string

func (Follower) ParentID

func (w Follower) ParentID() primitive.ObjectID

ParentID returns the ParentID property of this Follow

func (Follower) ParentType

func (w Follower) ParentType() string

ParentType returns the ParentType property of this Follow

func (w Follower) Permalink() string

func (Follower) Render

func (w Follower) Render() (template.HTML, error)

func (Follower) StateID

func (w Follower) StateID() string

ActorID returns the ActorID property of this Follow

func (Follower) Token

func (w Follower) Token() string

func (Follower) UpdateDate

func (w Follower) UpdateDate() int64

UpdateDate returns the UpdateDate property of this Follow

func (Follower) UserCan

func (w Follower) UserCan(string) bool

func (Follower) View

func (w Follower) View(actionID string) (template.HTML, error)

View executes a separate view for this Stream

type Group

type Group struct {
	CommonWithTemplate
	// 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) BasePath

func (w Group) BasePath() string

func (Group) GroupID

func (w Group) GroupID() string

func (Group) Groups

func (w Group) Groups() *QueryBuilder[model.Group]

func (Group) Label

func (w Group) Label() string

func (Group) NavigationID

func (w Group) NavigationID() string

func (Group) PageTitle

func (w Group) PageTitle() string
func (w Group) Permalink() string

func (Group) Render

func (w Group) Render() (template.HTML, error)

Render generates the string value for this Stream

func (Group) Token

func (w Group) Token() string

func (Group) View

func (w Group) View(actionID string) (template.HTML, error)

View executes a separate view for this Group

type Inbox

type Inbox struct {
	CommonWithTemplate
	// 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) AmFollowing

func (w Inbox) AmFollowing(url string) model.Following

func (Inbox) AnnouncesBefore

func (w Inbox) AnnouncesBefore(url string, dateString string, maxRows int) sliceof.Object[streams.Document]

func (Inbox) BasePath

func (w Inbox) BasePath() string

func (Inbox) DisplayName

func (w Inbox) DisplayName() string

func (Inbox) FilteredByFollowing

func (w Inbox) FilteredByFollowing() model.Following

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 (w Inbox) FollowerCount() int

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 (w Inbox) FollowingByToken(followingToken string) (model.Following, error)

func (Inbox) FollowingCount

func (w Inbox) FollowingCount() int

func (Inbox) HasRule

func (w Inbox) HasRule(ruleType string, trigger string) model.Rule

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) IconURL

func (w Inbox) IconURL() string

func (Inbox) Inbox

func (w Inbox) Inbox() (QueryBuilder[model.Message], error)

Inbox returns a QueryBuilder for current User's inbox

func (Inbox) IsInboxEmpty

func (w Inbox) IsInboxEmpty(inbox []model.Message) bool

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 (w Inbox) LikesBefore(url string, dateString string, maxRows int) sliceof.Object[streams.Document]

func (Inbox) Message

func (w Inbox) Message() model.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) Myself

func (w Inbox) Myself() bool

Myself returns TRUE if the current user is viewing their own profile

func (Inbox) NavigationID

func (w Inbox) NavigationID() string

NavigationID returns the ID to use for highlighing navigation menus

func (Inbox) PageTitle

func (w Inbox) PageTitle() string
func (w Inbox) Permalink() string

func (Inbox) ProfileURL

func (w Inbox) ProfileURL() string

func (Inbox) Render

func (w Inbox) Render() (template.HTML, error)

Render generates the string value for this Inbox

func (Inbox) RepliesAfter

func (w Inbox) RepliesAfter(url string, dateString string, maxRows int) sliceof.Object[streams.Document]

func (Inbox) RepliesBefore

func (w Inbox) RepliesBefore(url string, dateString string, maxRows int) sliceof.Object[streams.Document]

func (Inbox) RuleByToken

func (w Inbox) RuleByToken(token string) model.Rule

func (Inbox) RuleCount

func (w Inbox) RuleCount() int

func (Inbox) Rules

func (w Inbox) Rules() QueryBuilder[model.Rule]

func (Inbox) SubBuilder

func (w Inbox) SubBuilder(object any) (Builder, error)

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 (Inbox) Token

func (w Inbox) Token() string

func (Inbox) UserCan

func (w Inbox) UserCan(actionID string) bool

UserCan returns TRUE if this Request is authorized to access the requested view

func (Inbox) UserID

func (w Inbox) UserID() string

func (Inbox) Username

func (w Inbox) Username() string

func (Inbox) View

func (w Inbox) View(actionID string) (template.HTML, error)

View executes a separate view for this Inbox

type Model

type Model struct {
	CommonWithTemplate
	// contains filtered or unexported fields
}

Model builds objects from any model service that implements the ModelService interface

func NewModel

func NewModel(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, object data.Object, actionID string) (Model, error)

NewModel returns a fully initialized `Model` builder.

func (Model) BasePath

func (w Model) BasePath() string

func (Model) Label

func (w Model) Label() string

func (Model) Object

func (w Model) Object() any

func (Model) PageTitle

func (w Model) PageTitle() string
func (w Model) Permalink() string

func (Model) Render

func (w Model) Render() (template.HTML, error)

func (Model) Token

func (w Model) Token() string

func (Model) UserCan

func (w Model) UserCan(string) bool

func (Model) View

func (w Model) View(actionID string) (template.HTML, error)

View executes a separate view for this Stream

type Navigation struct {
	CommonWithTemplate
	// 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 (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)

Render generates the string value for this Stream

func (w Navigation) Token() string
func (w Navigation) View(actionID string) (template.HTML, error)

View executes a separate view for this Group

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 {
	CommonWithTemplate
	// 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) ActivityPubFollowersURL

func (w Outbox) ActivityPubFollowersURL() string

func (Outbox) ActivityPubFollowingURL

func (w Outbox) ActivityPubFollowingURL() string

func (Outbox) ActivityPubIconURL

func (w Outbox) ActivityPubIconURL() string

func (Outbox) ActivityPubInboxURL

func (w Outbox) ActivityPubInboxURL() string

func (Outbox) ActivityPubLikedURL

func (w Outbox) ActivityPubLikedURL() string

func (Outbox) ActivityPubOutboxURL

func (w Outbox) ActivityPubOutboxURL() string

func (Outbox) ActivityPubPublicKeyURL

func (w Outbox) ActivityPubPublicKeyURL() string

func (Outbox) ActivityPubURL

func (w Outbox) ActivityPubURL() string

func (Outbox) BasePath

func (w Outbox) BasePath() string

func (Outbox) Data

func (w Outbox) Data(path string) any

func (Outbox) DisplayName

func (w Outbox) DisplayName() string

func (Outbox) FollowerCount

func (w Outbox) FollowerCount() int

func (Outbox) FollowingCount

func (w Outbox) FollowingCount() int

func (Outbox) IconURL

func (w Outbox) IconURL() string

func (Outbox) ImageURL

func (w Outbox) ImageURL() string

func (Outbox) IsIndexable

func (w Outbox) IsIndexable() bool

IsIndexable returns TRUE if the stream is indexable by search engines

func (Outbox) IsMyself

func (w Outbox) IsMyself() bool

IsMyself returns TRUE if the outbox record is owned by the currently signed-in user

func (Outbox) IsPublic

func (w Outbox) IsPublic() bool

IsPublished returns TRUE if the stream has been published

func (w Outbox) Links() sliceof.Object[model.PersonLink]

func (Outbox) Location

func (w Outbox) Location() string

func (Outbox) Myself

func (w Outbox) Myself() bool

Myself returns TRUE if the current user is viewing their own profile

func (Outbox) NavigationID

func (w Outbox) NavigationID() string

NavigationID returns the ID to use for highlighing navigation menus

func (Outbox) OEmbedJSON

func (w Outbox) OEmbedJSON() string

OEmbedJSON returns the URL for the oEmbed JSON endpoint for this stream

func (Outbox) OEmbedXML

func (w Outbox) OEmbedXML() string

OEmbedXML returns the URL for the oEmbed XML endpoint for this stream

func (Outbox) Outbox

func (w Outbox) Outbox() QueryBuilder[model.StreamSummary]

func (Outbox) PageTitle

func (w Outbox) PageTitle() string
func (w Outbox) Permalink() string

func (Outbox) ProfileURL

func (w Outbox) ProfileURL() string

func (Outbox) Render

func (w Outbox) Render() (template.HTML, error)

Render generates the string value for this Outbox

func (Outbox) Replies

func (w Outbox) Replies() QueryBuilder[model.StreamSummary]

func (Outbox) Responses

func (w Outbox) Responses() QueryBuilder[model.Response]

func (Outbox) RuleCount

func (w Outbox) RuleCount() int

func (Outbox) StateID

func (w Outbox) StateID() string

func (Outbox) StatusMessage

func (w Outbox) StatusMessage() string

func (Outbox) Tags

func (w Outbox) Tags() sliceof.Object[mapof.String]

Tags returns all tags (mentions, hashtags, etc) for the stream being built

func (Outbox) Token

func (w Outbox) Token() string

func (Outbox) UserCan

func (w Outbox) UserCan(actionID string) bool

UserCan returns TRUE if this Request is authorized to access the requested view

func (Outbox) UserID

func (w Outbox) UserID() string

func (Outbox) Username

func (w Outbox) Username() string

func (Outbox) View

func (w Outbox) View(actionID string) (template.HTML, error)

View executes a separate view for this Outbox

type Pipeline

type Pipeline []step.Step

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

func (Pipeline) Get

func (pipeline Pipeline) Get(factory Factory, builder Builder, buffer io.Writer) PipelineResult

Get runs all of the pipeline steps using the GET method

func (Pipeline) IsEmpty

func (pipeline Pipeline) IsEmpty() bool

func (Pipeline) Post

func (pipeline Pipeline) Post(factory Factory, builder Builder, buffer io.Writer) PipelineResult

Post runs runs all of the pipeline steps using the POST method

type PipelineBehavior

type PipelineBehavior func(*PipelineResult)

func Continue

func Continue() PipelineBehavior

Continue is a NOOP that does not change the PipelineResult object

func Halt

func Halt() PipelineBehavior

Halt sets the Halt flag on 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 PipelineHalter interface {

	// HaltPipeline optionally allows a step to halt processing of an action pipeline
	HaltPipeline(Builder) bool
}

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 PropertyFormGetter

type PropertyFormGetter interface {
	PropertyForm() form.Element
}

type QueryBuilder

type QueryBuilder[T model.FieldLister] struct {
	// 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]) ByName

func (builder QueryBuilder[T]) ByName() 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]) ByRankAlt

func (builder QueryBuilder[T]) ByRankAlt() 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]) CaseInsensitive

func (builder QueryBuilder[T]) CaseInsensitive() QueryBuilder[T]

func (QueryBuilder[T]) CaseSensitive

func (builder QueryBuilder[T]) CaseSensitive() QueryBuilder[T]

func (QueryBuilder[T]) Count

func (builder QueryBuilder[T]) Count() (int64, error)

Count returns the number of records that match the query criteria

func (QueryBuilder[T]) Featured

func (builder QueryBuilder[T]) Featured() QueryBuilder[T]

func (QueryBuilder[T]) Indexable

func (builder QueryBuilder[T]) Indexable() QueryBuilder[T]

func (QueryBuilder[T]) Reverse

func (builder QueryBuilder[T]) Reverse() QueryBuilder[T]

func (QueryBuilder[T]) Slice

func (builder QueryBuilder[T]) Slice() (sliceof.Object[T], error)

Slice returns the results of the query as a slice of objects

func (QueryBuilder[T]) Tags

func (builder QueryBuilder[T]) Tags(tags ...string) 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]) Top150

func (builder QueryBuilder[T]) Top150() QueryBuilder[T]

func (QueryBuilder[T]) Top200

func (builder QueryBuilder[T]) Top200() QueryBuilder[T]

func (QueryBuilder[T]) Top30

func (builder QueryBuilder[T]) Top30() QueryBuilder[T]

func (QueryBuilder[T]) Top300

func (builder QueryBuilder[T]) Top300() QueryBuilder[T]

func (QueryBuilder[T]) Top400

func (builder QueryBuilder[T]) Top400() QueryBuilder[T]

func (QueryBuilder[T]) Top500

func (builder QueryBuilder[T]) Top500() 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]

func (QueryBuilder[T]) Where

func (builder QueryBuilder[T]) Where(field string, value any) QueryBuilder[T]

func (QueryBuilder[T]) WhereBeginsWith

func (builder QueryBuilder[T]) WhereBeginsWith(field string, value string) QueryBuilder[T]

func (QueryBuilder[T]) WhereContains

func (builder QueryBuilder[T]) WhereContains(field string, value string) QueryBuilder[T]

func (QueryBuilder[T]) WhereGT

func (builder QueryBuilder[T]) WhereGT(field string, value any) QueryBuilder[T]

func (QueryBuilder[T]) WhereIN

func (builder QueryBuilder[T]) WhereIN(field string, value any) QueryBuilder[T]

func (QueryBuilder[T]) WhereLT

func (builder QueryBuilder[T]) WhereLT(field string, value any) QueryBuilder[T]

type Registration

type Registration struct {
	Common
	// contains filtered or unexported fields
}

Registration is the builder for the admin/domain page It can only be accessed by a Registration Owner

func NewRegistration

func NewRegistration(factory Factory, request *http.Request, response http.ResponseWriter, registration *model.Registration, actionID string) (Registration, error)

NewRegistration returns a fully initialized `Registration` builder.

func (Registration) AllConnections

func (w Registration) AllConnections() mapof.Object[model.Connection]

Connection loads an external service connection from the database

func (Registration) BasePath

func (w Registration) BasePath() string

func (Registration) Data

func (w Registration) Data(key string) string

func (Registration) DomainData

func (w Registration) DomainData() mapof.String

func (Registration) IconURL

func (w Registration) IconURL() string

func (Registration) Label

func (w Registration) Label() string

func (Registration) NavigationID

func (w Registration) NavigationID() string

func (Registration) PageTitle

func (w Registration) PageTitle() string
func (w Registration) Permalink() string

func (Registration) Provider

func (w Registration) Provider(providerID string) providers.Provider

func (Registration) Providers

func (w Registration) Providers() []form.LookupCode

Providers lists all available external services that can be connected to this domain

func (Registration) RegistrationData

func (w Registration) RegistrationData(key string) string

func (Registration) Render

func (w Registration) Render() (template.HTML, error)

Render generates the string value for this Stream

func (Registration) Template

func (w Registration) Template() model.Registration

Template returns the registration template selected for this domain

func (Registration) ThemeData

func (w Registration) ThemeData(key string) string

func (Registration) Token

func (w Registration) Token() string

func (Registration) View

func (w Registration) View(actionID string) (template.HTML, error)

View executes a separate view for this Group

type Rule

type Rule struct {
	CommonWithTemplate
	// 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) BasePath

func (w Rule) BasePath() string

func (Rule) Label

func (w Rule) Label() string

func (Rule) NavigationID

func (w Rule) NavigationID() string

func (Rule) PageTitle

func (w Rule) PageTitle() string
func (w Rule) Permalink() string

func (Rule) Render

func (w Rule) Render() (template.HTML, error)

Render generates the string value for this Stream

func (Rule) RuleID

func (w Rule) RuleID() string

func (Rule) Rules

func (w Rule) Rules() *QueryBuilder[model.Rule]

func (Rule) ServerWideRules

func (w Rule) ServerWideRules() *QueryBuilder[model.Rule]

func (Rule) Token

func (w Rule) Token() string

func (Rule) View

func (w Rule) View(actionID string) (template.HTML, error)

View executes a separate view for this Rule

type SearchBuilder

type SearchBuilder struct {
	Criteria      exp.Expression
	SortField     string
	SortDirection string
	MaxRows       int64
	// contains filtered or unexported fields
}

func NewSearchBuilder

func NewSearchBuilder(service *service.Search, criteria exp.Expression) SearchBuilder

func (SearchBuilder) AfterRank

func (builder SearchBuilder) AfterRank(rank int64) SearchBuilder

func (SearchBuilder) AfterShuffle

func (builder SearchBuilder) AfterShuffle(shuffle int64) SearchBuilder

func (SearchBuilder) All

func (builder SearchBuilder) All() SearchBuilder

func (SearchBuilder) By

func (builder SearchBuilder) By(sortField string) SearchBuilder

func (SearchBuilder) ByCreateDate

func (builder SearchBuilder) ByCreateDate() SearchBuilder

func (SearchBuilder) ByName

func (builder SearchBuilder) ByName() SearchBuilder

func (SearchBuilder) ByRank

func (builder SearchBuilder) ByRank() SearchBuilder

func (SearchBuilder) ByShuffle

func (builder SearchBuilder) ByShuffle() SearchBuilder

func (SearchBuilder) Count

func (builder SearchBuilder) Count() (int64, error)

Count returns the number of records that match the query criteria

func (SearchBuilder) Range

func (builder SearchBuilder) Range() (iter.Seq[model.SearchResult], error)

Range returns the results of the query as a Go 1.23 RangeFunc

func (SearchBuilder) Reverse

func (builder SearchBuilder) Reverse() SearchBuilder

func (SearchBuilder) Slice

func (builder SearchBuilder) Slice() (sliceof.Object[model.SearchResult], error)

Slice returns the results of the query as a slice of objects

func (SearchBuilder) Top1

func (builder SearchBuilder) Top1() SearchBuilder

func (SearchBuilder) Top12

func (builder SearchBuilder) Top12() SearchBuilder

func (SearchBuilder) Top120

func (builder SearchBuilder) Top120() SearchBuilder

func (SearchBuilder) Top150

func (builder SearchBuilder) Top150() SearchBuilder

func (SearchBuilder) Top200

func (builder SearchBuilder) Top200() SearchBuilder

func (SearchBuilder) Top30

func (builder SearchBuilder) Top30() SearchBuilder

func (SearchBuilder) Top300

func (builder SearchBuilder) Top300() SearchBuilder

func (SearchBuilder) Top400

func (builder SearchBuilder) Top400() SearchBuilder

func (SearchBuilder) Top500

func (builder SearchBuilder) Top500() SearchBuilder

func (SearchBuilder) Top6

func (builder SearchBuilder) Top6() SearchBuilder

func (SearchBuilder) Top60

func (builder SearchBuilder) Top60() SearchBuilder

func (SearchBuilder) Top600

func (builder SearchBuilder) Top600() SearchBuilder

func (SearchBuilder) Where

func (builder SearchBuilder) Where(field string, value any) SearchBuilder

func (SearchBuilder) WhereTags

func (builder SearchBuilder) WhereTags(tags ...string) SearchBuilder

func (SearchBuilder) WhereType

func (builder SearchBuilder) WhereType(typeNames ...string) SearchBuilder

type SearchTag

type SearchTag struct {
	CommonWithTemplate
	// contains filtered or unexported fields
}

SearchTag is a builder for the admin/searchTags page It can only be accessed by a Domain Owner

func NewSearchTag

func NewSearchTag(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, searchTag *model.SearchTag, actionID string) (SearchTag, error)

NewSearchTag returns a fully initialized `SearchTag` builder.

func (SearchTag) BasePath

func (w SearchTag) BasePath() string

func (SearchTag) Groups

func (w SearchTag) Groups() []form.LookupCode

func (SearchTag) Name

func (w SearchTag) Name() string

func (SearchTag) NavigationID

func (w SearchTag) NavigationID() string

func (SearchTag) PageTitle

func (w SearchTag) PageTitle() string
func (w SearchTag) Permalink() string

func (SearchTag) Render

func (w SearchTag) Render() (template.HTML, error)

Render generates the string value for this Stream

func (SearchTag) SearchTagID

func (w SearchTag) SearchTagID() string

func (SearchTag) SearchTags

func (w SearchTag) SearchTags() *QueryBuilder[model.SearchTag]

SearchTags returns a query builder for all SearchTags in the datatabase.

func (SearchTag) States

func (w SearchTag) States() []form.LookupCode

func (SearchTag) Token

func (w SearchTag) Token() string

func (SearchTag) View

func (w SearchTag) View(actionID string) (template.HTML, error)

View executes a separate view for this SearchTag

type ServerFactory

type ServerFactory interface {
	ByDomainName(string) (Factory, error)
}

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

func ExecutableStep(stepInfo step.Step) Step

ExecutableStep uses an Step object to create a new action

type StepAddModelObject

type StepAddModelObject struct {
	Form     form.Element
	Defaults []step.Step
}

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

type StepAsConfirmation struct {
	Title   string
	Message string
	Submit  string
}

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

type StepAsModal struct {
	SubSteps   []step.Step
	Options    []string
	Background string
}

StepAsModal is a 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

type StepAsTooltip struct {
	SubSteps []step.Step
}

StepAsTooltip is a 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 StepCacheURL

type StepCacheURL struct {
	CacheControl string
}

StepCacheURL is an action that can add new model objects of any type

func (StepCacheURL) Get

func (step StepCacheURL) Get(builder Builder, buffer io.Writer) PipelineBehavior

Get displays a modal form that lets users enter data for their new model object.

func (StepCacheURL) Post

func (step StepCacheURL) 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 StepDelete

type StepDelete struct {
	Title   *template.Template
	Message *template.Template
	Submit  string
	Method  string
}

StepDelete is a 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 StepDeleteArchive

type StepDeleteArchive struct {
	Token string
}

StepDeleteArchive is a Step that can delete a Stream from the Domain

func (StepDeleteArchive) Get

func (step StepDeleteArchive) Get(builder Builder, buffer io.Writer) PipelineBehavior

Get displays a customizable confirmation form for the delete

func (StepDeleteArchive) Post

func (step StepDeleteArchive) 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
	Field    string
	Category string
}

StepDeleteAttachments represents an action that can delete ine or more attachments. It can only be used on a StreamBuilder

func (StepDeleteAttachments) Get

func (StepDeleteAttachments) Post

func (step StepDeleteAttachments) Post(builder Builder, _ io.Writer) PipelineBehavior

type StepDo

type StepDo struct {
	Action string
}

StepDo is a Step that executes another action within this context.

func (StepDo) Get

func (step StepDo) Get(builder Builder, buffer io.Writer) PipelineBehavior

func (StepDo) Post

func (step StepDo) Post(builder Builder, buffer io.Writer) PipelineBehavior

Post updates the stream with approved data from the request body.

type StepDump

type StepDump struct {
	Value *template.Template
}

StepDump is a Step that can delete a Stream from the Domain

func (StepDump) Get

func (step StepDump) Get(builder Builder, buffer io.Writer) PipelineBehavior

Get displays a customizable confirmation form for the delete

func (StepDump) Post

func (step StepDump) Post(builder Builder, _ io.Writer) PipelineBehavior

Post removes the object from the database (likely using a soft-delete, though)

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

type StepEditContent struct {
	Filename  string
	Fieldname string
	Format    string
}

StepEditContent is a 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

type StepEditModelObject struct {
	Form    form.Element
	Options []*template.Template
}

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 StepEditRegistration

type StepEditRegistration struct{}

StepEditRegistration is a Step that can update the data.DataMap custom data stored in a Stream

func (StepEditRegistration) Get

func (step StepEditRegistration) Get(builder Builder, buffer io.Writer) PipelineBehavior

func (StepEditRegistration) Post

func (step StepEditRegistration) Post(builder Builder, _ io.Writer) PipelineBehavior

Post updates the stream with approved data from the request body.

type StepEditTemplate

type StepEditTemplate struct {
	Title string
	Paths []string
}

StepEditTemplate is a Step that lets users choose their profile template(s)

func (StepEditTemplate) Get

func (step StepEditTemplate) Get(builder Builder, buffer io.Writer) PipelineBehavior

Get displays a form where users can select their profile template(s)

func (StepEditTemplate) Post

func (step StepEditTemplate) Post(builder Builder, _ io.Writer) PipelineBehavior

Post updates a User's profile template(s)

type StepEditWidget

type StepEditWidget struct{}

StepEditWidget is a Step that displays a form for editing Widgets.

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 a Widget's configuration data.

type StepError

type StepError struct {
	Original step.Step
}

func (StepError) Get

func (step StepError) Get(builder Builder, buffer io.Writer) PipelineBehavior

func (StepError) Post

func (step StepError) Post(builder Builder, _ io.Writer) PipelineBehavior

type StepForwardTo

type StepForwardTo struct {
	URL *template.Template
}

StepForwardTo is a 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 StepGetArchive

type StepGetArchive struct {
	Token       string
	Depth       int
	JSON        bool
	Attachments bool
	Metadata    [][]map[string]any
}

StepGetArchive is a Step that can delete a Stream from the Domain

func (StepGetArchive) FileNotReady

func (step StepGetArchive) FileNotReady(builder Builder, writer io.Writer) PipelineBehavior

func (StepGetArchive) Get

func (step StepGetArchive) Get(builder Builder, writer io.Writer) PipelineBehavior

Get displays a customizable confirmation form for the delete

func (StepGetArchive) Post

func (step StepGetArchive) Post(builder Builder, _ io.Writer) PipelineBehavior

Post removes the object from the database (likely using a soft-delete, though)

type StepHalt

type StepHalt struct{}

StepHalt is a Step that can save changes to any object

func (StepHalt) Get

func (step StepHalt) Get(builder Builder, _ io.Writer) PipelineBehavior

func (StepHalt) Post

func (step StepHalt) Post(builder Builder, _ io.Writer) PipelineBehavior

Post saves the object to the database

type StepIfCondition

type StepIfCondition struct {
	Condition *template.Template
	Then      []step.Step
	Otherwise []step.Step
}

StepIfCondition is a 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

type StepInlineError struct {
	Message *template.Template
}

StepInlineError is a 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 StepInlineSaveButton

type StepInlineSaveButton struct {
	ID    *template.Template
	Class string
	Label *template.Template
}

StepInlineSaveButton is a Step that can build a Stream into HTML

func (StepInlineSaveButton) Get

func (step StepInlineSaveButton) Get(builder Builder, buffer io.Writer) PipelineBehavior

Get builds the Stream HTML to the context

func (StepInlineSaveButton) Post

func (step StepInlineSaveButton) Post(builder Builder, buffer io.Writer) PipelineBehavior

type StepInlineSuccess

type StepInlineSuccess struct {
	Message *template.Template
}

StepInlineSuccess is a 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 StepMakeArchive

type StepMakeArchive struct {
	Token       string
	Depth       int
	JSON        bool
	Attachments bool
	Metadata    [][]map[string]any
}

StepMakeArchive is a Step that can delete a Stream from the Domain

func (StepMakeArchive) Get

func (step StepMakeArchive) Get(builder Builder, buffer io.Writer) PipelineBehavior

Get displays a customizable confirmation form for the delete

func (StepMakeArchive) Post

func (step StepMakeArchive) Post(builder Builder, _ io.Writer) PipelineBehavior

Post removes the object from the database (likely using a soft-delete, though)

type StepProcessContent

type StepProcessContent struct {
	RemoveHTML bool
	AddTags    bool
	AddLinks   bool
}

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 StepProcessTags

type StepProcessTags struct {
	Paths []string
}

StepProcessTags is an action step that adds tags to a stream, either by scanning the content, or by calculating template values

func (StepProcessTags) Get

func (step StepProcessTags) 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 (StepProcessTags) Post

func (step StepProcessTags) Post(builder Builder, buffer io.Writer) PipelineBehavior

type StepRedirectTo

type StepRedirectTo struct {
	URL *template.Template
}

StepRedirectTo is a 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 is a 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 is a 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 is a Step that forwards the user to a new page.

func (StepRemoveEvent) Get

func (StepRemoveEvent) Post

Post updates the stream with approved data from the request body.

type StepSave

type StepSave struct {
	Comment *template.Template
	Method  string
}

StepSave is a Step that can save changes to any object

func (StepSave) Get

func (step StepSave) Get(builder Builder, _ io.Writer) PipelineBehavior

func (StepSave) Post

func (step StepSave) Post(builder Builder, _ io.Writer) PipelineBehavior

Post saves the object to the database

type StepSaveAndPublish

type StepSaveAndPublish struct {
	Outbox bool
}

StepSaveAndPublish is a Step that can update a stream's PublishDate with the current time.

func (StepSaveAndPublish) Get

func (step StepSaveAndPublish) Get(builder Builder, _ io.Writer) PipelineBehavior

func (StepSaveAndPublish) Post

func (step StepSaveAndPublish) Post(builder Builder, _ io.Writer) PipelineBehavior

Post updates the stream with the current date as the "PublishDate"

type StepSearchIndex

type StepSearchIndex struct {
	Action string
	If     *template.Template
}

StepSearchIndex is a Step that can update a stream's PublishDate with the current time.

func (StepSearchIndex) Get

func (step StepSearchIndex) Get(builder Builder, _ io.Writer) PipelineBehavior

func (StepSearchIndex) Post

func (step StepSearchIndex) Post(builder Builder, _ io.Writer) PipelineBehavior

Post updates the stream with the current date as the "PublishDate"

type StepSendEmail

type StepSendEmail struct {
	Email string
}

StepSendEmail is a Step that can send a named email to a recipient

func (StepSendEmail) Get

func (StepSendEmail) Post

func (step StepSendEmail) Post(builder Builder, _ io.Writer) PipelineBehavior

Post saves the object to the database

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 is a 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

type StepSetHeader struct {
	Method string
	Name   string
	Value  *template.Template
}

StepSetHeader is a 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 StepSetPassword

type StepSetPassword struct {
}

StepSetPassword is a Step that can update a user's password

func (StepSetPassword) Get

func (step StepSetPassword) Get(builder Builder, buffer io.Writer) PipelineBehavior

func (StepSetPassword) Post

func (step StepSetPassword) Post(builder Builder, _ io.Writer) PipelineBehavior

Post updates the stream with approved data from the request body.

type StepSetQueryParam

type StepSetQueryParam struct {
	Values map[string]*template.Template
}

StepSetQueryParam is a 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

type StepSetRenderData struct {
	Values map[string]*template.Template
}

StepSetRenderData is a 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 StepSetSimpleSharing

type StepSetSimpleSharing struct {
	Title   string
	Message string
	Roles   []string
}

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 is a 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 is a 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 StepSleep

type StepSleep struct {
	Duration int
}

StepSleep is a Step that sleeps for a determined period of time. It should really only be used for debugging.

func (StepSleep) Get

func (step StepSleep) Get(builder Builder, buffer io.Writer) PipelineBehavior

func (StepSleep) Post

func (step StepSleep) Post(builder Builder, buffer io.Writer) PipelineBehavior

type StepSort

type StepSort struct {
	Model   string
	Keys    string
	Values  string
	Message string
}

StepSort is a Step that can update multiple records at once

func (StepSort) Get

func (step StepSort) Get(builder Builder, _ io.Writer) PipelineBehavior

func (StepSort) Post

func (step StepSort) Post(builder Builder, _ io.Writer) PipelineBehavior

Post updates the stream with approved data from the request body.

type StepSortAttachments

type StepSortAttachments struct {
	Keys    string
	Values  string
	Message string
}

StepSortAttachments is a 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 is a 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 is a Step that can copy the Container from a StreamDraft into its corresponding Stream

func (StepStreamPromoteDraft) Get

func (StepStreamPromoteDraft) Post

Post copies relevant information from the draft into the primary stream, then deletes the draft

type StepTableEditor

type StepTableEditor struct {
	Path string
	Form form.Element
}

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

type StepTriggerEvent struct {
	Event string
	Value *template.Template
}

StepTriggerEvent is a 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 {
	Outbox bool
}

StepUnPublish is a 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 StepUploadAttachments

type StepUploadAttachments struct {
	Action         string // Action to perform when uploading the attachment ("append" or "replace")
	Fieldname      string // Name of the form field that contains the file data (Default: "file")
	AttachmentPath string // Path name to store the AttachmentID
	DownloadPath   string // Path name to store the download URL
	FilenamePath   string // Path name to store the original filename
	AcceptType     string // Mime Type(s) to accept (e.g. "image/*")
	Category       string // Category to apply to the Attachment
	Maximum        int    // Maximum number of uploads to allow (Default: 1)
	JSONResult     bool   // If TRUE, return a JSON structure with result data. This forces Maximum=1

	Label                string // Value to set as the attachment.label
	LabelFieldname       string // Form field that defines the attachment label
	Description          string // Value to set as the attachment.description
	DescriptionFieldname string // Form field that defines the attachment description

	RuleHeight int      // Fixed height for all downloads
	RuleWidth  int      // Fixed width for all downloads
	RuleTypes  []string // Allowed extensions.  The first value is used as the default.
}

StepUploadAttachments represents an action that can upload attachments. It can only be used on a StreamBuilder

func (StepUploadAttachments) Get

func (StepUploadAttachments) Post

func (step StepUploadAttachments) Post(builder Builder, buffer io.Writer) PipelineBehavior

type StepViewCSS

type StepViewCSS struct {
	File string
}

StepViewCSS is a Step that can build a Stream into HTML

func (StepViewCSS) Get

func (step StepViewCSS) Get(builder Builder, buffer io.Writer) PipelineBehavior

Get builds the Stream HTML to the context

func (StepViewCSS) Post

func (step StepViewCSS) Post(builder Builder, buffer io.Writer) PipelineBehavior

type StepViewFeed

type StepViewFeed struct{}

StepViewFeed is a 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

type StepViewHTML struct {
	File       string
	Method     string
	AsFullPage bool
}

StepViewHTML is a 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 is a 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 is a 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 StepWithAttachment

type StepWithAttachment struct {
	SubSteps []step.Step
}

StepWithAttachment is a Step that can update the data.DataMap custom data stored in a Stream

func (StepWithAttachment) Get

func (step StepWithAttachment) Get(builder Builder, buffer io.Writer) PipelineBehavior

func (StepWithAttachment) Post

func (step StepWithAttachment) Post(builder Builder, buffer io.Writer) PipelineBehavior

Post updates the stream with approved data from the request body.

type StepWithChildren

type StepWithChildren struct {
	SubSteps []step.Step
}

StepWithChildren is a 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

type StepWithDraft struct {
	SubSteps []step.Step
}

StepWithDraft is a 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

type StepWithFolder struct {
	SubSteps []step.Step
}

StepWithFolder is a 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

type StepWithFollower struct {
	SubSteps []step.Step
}

StepWithFollower is a 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

type StepWithFollowing struct {
	SubSteps []step.Step
}

StepWithFollowing is a 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

type StepWithMessage struct {
	SubSteps []step.Step
}

StepWithMessage is a 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

type StepWithNextSibling struct {
	SubSteps []step.Step
}

StepWithNextSibling is a 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

type StepWithParent struct {
	SubSteps []step.Step
}

StepWithParent is a 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

type StepWithPrevSibling struct {
	SubSteps []step.Step
}

StepWithPrevSibling is a 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

type StepWithResponse struct {
	SubSteps []step.Step
}

StepWithResponse is a 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

type StepWithRule struct {
	SubSteps []step.Step
}

StepWithRule is a 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 {
	CommonWithTemplate
	// 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 (w Stream) AnnouncesBefore(dateString string, maxRows int) sliceof.Object[streams.Document]

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() (sliceof.Object[model.Attachment], error)

Attachments lists all attachments for this stream.

func (Stream) AttachmentsByCategory

func (w Stream) AttachmentsByCategory(category string) (sliceof.Object[model.Attachment], error)

AttachmentByType 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) BasePath

func (w Stream) BasePath() string

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

func (w Stream) ContentHTML() template.HTML

Returns the body content as an HTML template

func (Stream) ContentRaw

func (w Stream) ContentRaw() string

func (Stream) CreateDate

func (w Stream) CreateDate() int64

CreateDate returns the CreateDate of the stream being built

func (Stream) Data

func (w Stream) Data(value string) any

Data returns the custom data field as an "any" type

func (Stream) DataBool

func (w Stream) DataBool(value string) bool

DataBool returns a custom data field converted to a bool

func (Stream) DataInt

func (w Stream) DataInt(value string) int

DataInt returns a custom data field converted to an integer

func (Stream) DataString

func (w Stream) DataString(value string) string

DataString returns a custom data field converted to a string

func (Stream) Document

func (w Stream) Document() model.DocumentLink

Document returns the DocumentLink record for this stream

func (Stream) ETag

func (w Stream) ETag() string

ETag returns the ETag for the stream being built

func (Stream) FirstChild

func (w Stream) FirstChild(sort string, action string) (Stream, error)

FirstChild returns the first child Stream underneath this one, based on the provided sort field

func (Stream) Followers

func (w Stream) Followers() ([]model.Follower, error)

func (Stream) Grandparent

func (w Stream) Grandparent(actionID string) (Stream, error)

Grandparent returns a Stream renderer containing the parent of the parent of the current stream

func (Stream) HasGrandparent

func (w Stream) HasGrandparent() bool

HasGrandparent returns TRUE if the stream

func (Stream) HasParent

func (w Stream) HasParent() bool

HasParent returns TRUE if the stream being built has a parent object

func (Stream) IconURL

func (w Stream) IconURL() string

IconURL returns the thumbnail image URL of the stream being built

func (Stream) InReplyTo

func (w Stream) InReplyTo() streams.Document

InReplyTo returns an ActivityStream reference to the URL that this stream replies to

func (Stream) IsCurrentStream

func (w Stream) IsCurrentStream() bool

func (Stream) IsEmpty

func (w Stream) IsEmpty() bool

IsEmpty returns TRUE if the stream is an empty placeholder.

func (Stream) IsNew

func (w Stream) IsNew() bool

IsNew returns TRUE if this stream has not been saved to the database

func (Stream) IsPublished

func (w Stream) IsPublished() bool

IsPublished returns TRUE if the stream being built has been published

func (Stream) IsReply

func (w Stream) IsReply() bool

IsReply returns TRUE if this stream is marked as a reply to another stream or resource

func (Stream) Label

func (w Stream) Label() string

Label returns the Label for the stream being built

func (Stream) LastChild

func (w Stream) LastChild(sort string, action string) (Stream, error)

FirstChild returns the first child Stream underneath this one, based on the provided sort field

func (Stream) LikesBefore

func (w Stream) LikesBefore(dateString string, maxRows int) sliceof.Object[streams.Document]

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) Mentions

func (w Stream) Mentions() ([]model.Mention, error)

Mentions returns a slice of all Mentions for this Stream

func (Stream) NavigationID

func (w Stream) NavigationID() string

NavigationID returns the unique ID of the top-level stream in this stream's hierarchy

func (Stream) NextSibling

func (w Stream) NextSibling(sortField string, action string) (Stream, error)

NextSibling returns the sibling Stream that immediately follows this one, based on the provided sort field

func (Stream) OEmbedJSON

func (w Stream) OEmbedJSON() string

OEmbedJSON returns the URL for the oEmbed JSON endpoint for this stream

func (Stream) OEmbedXML

func (w Stream) OEmbedXML() string

OEmbedXML returns the URL for the oEmbed XML endpoint for this stream

func (Stream) Outbox

func (w Stream) Outbox() (QueryBuilder[model.OutboxMessage], error)

Outbox returns a QueryBuilder for the current Stream's outbox

func (Stream) PageTitle

func (w Stream) PageTitle() string

PageTitle returns the Label for the stream being built

func (Stream) Parent

func (w Stream) Parent(actionID string) (Stream, error)

Parent returns a Stream renderer containing the parent of the current stream

func (Stream) ParentID

func (w Stream) ParentID() string

StreamID returns the unique ID for the stream being built

func (Stream) ParentOutbox

func (w Stream) ParentOutbox(actionID string) (Outbox, error)

ParentOutbox returns an Outbox builder containing the parent of the current stream

func (w Stream) Permalink() string

Permalink returns a complete URL for this stream

func (Stream) PrevSibling

func (w Stream) PrevSibling(sortField string, action string) (Stream, error)

PrevSibling returns the sibling Stream that immediately preceeds this one, based on the provided sort field

func (Stream) PublishDate

func (w Stream) PublishDate() int64

PublishDate returns the PublishDate of the stream being built

func (Stream) Rank

func (w Stream) Rank() int

Rank returns the Rank of the stream being built

func (Stream) Render

func (w Stream) Render() (template.HTML, error)

Render generates the string value for this Stream

func (Stream) RepliesAfter

func (w Stream) RepliesAfter(dateString string, maxRows int) sliceof.Object[streams.Document]

func (Stream) RepliesBefore

func (w Stream) RepliesBefore(dateString string, maxRows int) sliceof.Object[streams.Document]

RepliesBefore returns a slice of all ActivityStreams before the specified date

func (Stream) Roles

func (w Stream) Roles() []string

func (Stream) ShortSummary

func (w Stream) ShortSummary() string

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) StateID

func (w Stream) StateID() string

StateID returns the current state of the stream being built

func (Stream) StreamID

func (w Stream) StreamID() string

StreamID returns the unique ID for the stream being built

func (Stream) Streams

func (w Stream) Streams() QueryBuilder[model.StreamSummary]

func (Stream) Summary

func (w Stream) Summary() string

Summary returns the description of the stream being built

func (Stream) SummaryHTML

func (w Stream) SummaryHTML() template.HTML

SummaryHTML returns the description of the stream being built

func (Stream) Tags

func (w Stream) Tags() []mapof.String

Tags returns all tags (mentions, hashtags, etc) for the stream being built

func (Stream) TemplateID

func (w Stream) TemplateID() string

TemplateID returns the name of the template being used

func (Stream) Token

func (w Stream) Token() string

Token returns the unique URL token for the stream being built

func (Stream) UpdateDate

func (w Stream) UpdateDate() int64

UpdateDate returns the UpdateDate of the stream being built

func (Stream) UserCan

func (w Stream) UserCan(actionID string) bool

UserCan returns TRUE if this Request is authorized to access the requested view

func (Stream) Users

func (w Stream) Users() QueryBuilder[model.UserSummary]

func (Stream) View

func (w Stream) View(actionID string) (template.HTML, error)

View executes a separate view for this Stream

func (Stream) Widgets

func (w Stream) Widgets(location string) (template.HTML, error)

Widgets returns HTML for all the widgets in the specified location

type Syndication

type Syndication struct {
	CommonWithTemplate
	// contains filtered or unexported fields
}

func NewSyndication

func NewSyndication(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, actionID string) (Syndication, error)

NewSyndication returns a fully initialized `Syndication` builder.

func (Syndication) BasePath

func (w Syndication) BasePath() string

func (Syndication) NavigationID

func (w Syndication) NavigationID() string

func (Syndication) PageTitle

func (w Syndication) PageTitle() string
func (w Syndication) Permalink() string

func (Syndication) Render

func (w Syndication) Render() (template.HTML, error)

Render generates the string value for this Stream

func (Syndication) Token

func (w Syndication) Token() string

func (Syndication) View

func (w Syndication) View(actionID string) (template.HTML, error)

View executes a separate view for this Group

type TemplateLike

type TemplateLike interface {
	Execute(wr io.Writer, data interface{}) error
}

type User

type User struct {
	CommonWithTemplate
	// 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

func (w User) AssignedGroups() ([]model.Group, error)

AssignedGroups lists all groups to which the current user is assigned.

func (User) BasePath

func (w User) BasePath() string

func (User) CountIndexableUsers

func (w User) CountIndexableUsers() (int64, error)

CountIndexableUsers returns the total number of users marked "isIndexable"

func (User) CountPublicUsers

func (w User) CountPublicUsers() (int64, error)

CountPublicUsers returns the total number of users marked "isPublic"

func (User) CountUsers

func (w User) CountUsers() (int64, error)

CountUsers returns the total number of users in the database

func (User) DisplayName

func (w User) DisplayName() string

func (User) Groups

func (w User) Groups() ([]form.LookupCode, error)

Groups returns a slice of all Groups in the database

func (User) IconURL

func (w User) IconURL() string

func (User) Label

func (w User) Label() string

func (User) MapIDs

func (w User) MapIDs() map[string]string

func (User) NavigationID

func (w User) NavigationID() string

func (User) PageTitle

func (w User) PageTitle() string
func (w User) Permalink() string

func (User) ProfileURL

func (w User) ProfileURL() string

func (User) Registration

func (w User) Registration() model.Registration

Registration returns the signup template selected for this domain

func (User) Render

func (w User) Render() (template.HTML, error)

Render generates the string value for this User

func (User) Token

func (w User) Token() string

func (User) UserID

func (w User) UserID() string

func (User) Users

func (w User) Users() *QueryBuilder[model.UserSummary]

func (User) View

func (w User) View(actionID string) (template.HTML, error)

View executes a separate view for this User

type Webhook

type Webhook struct {
	CommonWithTemplate
	// contains filtered or unexported fields
}

Webhook is a builder for the admin/webhooks page It can only be accessed by a Domain Owner

func NewWebhook

func NewWebhook(factory Factory, request *http.Request, response http.ResponseWriter, template model.Template, webhook *model.Webhook, actionID string) (Webhook, error)

NewWebhook returns a fully initialized `Webhook` builder.

func (Webhook) BasePath

func (w Webhook) BasePath() string

func (Webhook) Events

func (w Webhook) Events() []string

func (Webhook) Label

func (w Webhook) Label() string

func (Webhook) NavigationID

func (w Webhook) NavigationID() string

func (Webhook) PageTitle

func (w Webhook) PageTitle() string
func (w Webhook) Permalink() string

func (Webhook) Render

func (w Webhook) Render() (template.HTML, error)

Render generates the string value for this Webhook

func (Webhook) TargetURL

func (w Webhook) TargetURL() string

func (Webhook) Token

func (w Webhook) Token() string

func (Webhook) View

func (w Webhook) View(actionID string) (template.HTML, error)

View executes a separate view for this Webhook

func (Webhook) WebhookID

func (w Webhook) WebhookID() string

func (Webhook) Webhooks

func (w Webhook) Webhooks() *QueryBuilder[model.Webhook]

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.

func NewWidget

func NewWidget(builder *Stream, widget model.StreamWidget) Widget

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳