door

package
v0.15.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyPayload added in v0.10.0

func EmptyPayload() printer.Payload

Types

type Done

type Done = bool

type Door

type Door struct {
	// contains filtered or unexported fields
}

Door renders content that can be updated, replaced, or removed after render.

func (*Door) Freeze added in v0.15.0

func (d *Door) Freeze(ctx context.Context) <-chan error

Freeze keeps the Door's current markup on the page but releases everything behind it: hooks, subscriptions, and nested Doors. Interactive elements inside stay visible but silently stop working. Unlike Door.Static, no content is sent. The Door keeps its stored state and can be mounted again.

Made for content that is dynamic only for a while and then final: blocks in a growing feed, log or chat entries, streamed output. Freeze the finished block, drop the reference, and server memory stays flat as the page grows.

The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.

func (*Door) Inner added in v0.10.0

func (d *Door) Inner(ctx context.Context, content any) <-chan error

Inner replaces the Door's children while keeping the same container mounted. A nil content empties it.

The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.

func (*Door) Main

func (d *Door) Main() gox.Elem

Main renders the Door directly in GoX:

~(&doors.Door{})

func (*Door) Outer added in v0.10.0

func (d *Door) Outer(ctx context.Context, outer any) <-chan error

Outer replaces the Door container and its children with outer. A nil outer leaves an empty container. Unlike Door.Static, the result remains a live Door that can be updated further.

The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.

func (*Door) Proxy

func (d *Door) Proxy(cur gox.Cursor, el gox.Elem) error

Proxy renders the Door in GoX with the following element as its container:

~>(&doors.Door{}) <div>content</div>

func (*Door) Reload

func (d *Door) Reload(ctx context.Context) <-chan error

Reload rerenders the Door with its current content.

The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.

func (*Door) Static added in v0.10.0

func (d *Door) Static(ctx context.Context, content any) <-chan error

Static removes the Door container and renders content in its place. A nil content leaves nothing in place. Unlike Door.Outer, the result is no longer a live Door; later operations change the stored state without putting the Door back on the page.

The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.

func (*Door) Unmount

func (d *Door) Unmount(ctx context.Context) <-chan error

Unmount removes the Door from the page and keeps its current content for a future mount. Unlike Door.Static, the Door stays live and can be mounted again.

The returned channel is optional to use. On success it sends two nil values then closes: the first means the call was scheduled, the second means it was applied to the page. On failure it sends an error then closes; context.Canceled means a newer operation superseded this one. If the Door is not mounted, it closes immediately without sending a value. Do not wait on the channel during rendering; to wait, use doors.Go or your own goroutine with doors.DetachedContext.

type Error added in v0.10.0

type Error struct {
	// contains filtered or unexported fields
}

func (Error) Error added in v0.10.0

func (e Error) Error() string

func (Error) Free added in v0.15.2

func (e Error) Free()

func (Error) Lock added in v0.15.2

func (e Error) Lock() bool

func (Error) Main added in v0.10.0

func (e Error) Main() gox.Elem

func (Error) Payload added in v0.10.0

func (e Error) Payload() (actions.Payload, bool)

func (Error) Release added in v0.10.0

func (e Error) Release()

func (Error) Unwrap added in v0.15.0

func (e Error) Unwrap() error

type Instance

type Instance interface {
	Call(call actions.Call)
	core.Instance
}

type Pipe added in v0.10.0

type Pipe = *pipe

type Root

type Root = *root

func NewRoot

func NewRoot(inst Instance) Root

func (Root) ID

func (r Root) ID() uint64

func (Root) IsStatic

func (r Root) IsStatic() bool

func (Root) Kill

func (r Root) Kill()

func (Root) Render

func (r Root) Render(requestCtx context.Context, comp gox.Comp) (Stack, error)

type Stack

type Stack []*deque.Deque[any]

func (*Stack) Print added in v0.10.0

func (p *Stack) Print(pr gox.Printer) error

func (*Stack) Release added in v0.13.19

func (p *Stack) Release()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL