dom

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const EventTypeAbort = "abort"

Variables

This section is empty.

Functions

func AbortContext added in v0.8.0

func AbortContext(ctx context.Context, signal *AbortSignal) context.Context

AbortContext will listen to abort events from an AbortSignal. The return value is a child context of ctx which will be cancelled if a, abort event is dispatched before the parent context cancels.

If the context is cancelled due to an abort event, the abort reason can be used as the cancel cause, which can be read using context.Cause. If the cause is not an error type, an [ErrAny] will be returned.

Types

type AbortController added in v0.8.0

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

func NewAbortController added in v0.8.0

func NewAbortController() *AbortController

func (*AbortController) Abort added in v0.8.0

func (c *AbortController) Abort(reason any)

func (*AbortController) Signal added in v0.8.0

func (c *AbortController) Signal() *AbortSignal

type AbortSignal added in v0.8.0

type AbortSignal struct {
	event.EventTarget
	// contains filtered or unexported fields
}

func (AbortSignal) Aborted added in v0.8.0

func (s AbortSignal) Aborted() bool

func (AbortSignal) Onabort added in v0.8.0

func (s AbortSignal) Onabort() event.EventHandler

func (AbortSignal) Reason added in v0.8.0

func (s AbortSignal) Reason() any

func (AbortSignal) SetOnabort added in v0.8.0

func (s AbortSignal) SetOnabort(event.EventHandler)

func (AbortSignal) ThrowIfAborted added in v0.8.0

func (s AbortSignal) ThrowIfAborted() error

type ChildrenRenderer

type ChildrenRenderer interface {
	RenderChildren(*strings.Builder)
}

ChildrenRenderer is the interface for DOM types that have children that can be rendered.

ChildrenRenderer is used for generating HTML and TextContent from DOM nodes.

type Renderer

type Renderer interface {
	Render(*strings.Builder)
}

Renderer is the interface for DOM types that can render themselves.

Renderer is used for generating HTML and TextContent from DOM nodes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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