document

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package document defines the bounded input contract shared by every update transport and the on-device renderer.

Index

Constants

View Source
const (
	MaxEncodedBytes = 32 * 1024
	MaxNodes        = 256
	MaxDepth        = 16
	MaxAttributes   = 8
	MaxStyles       = 512
	MaxTextBytes    = 24 * 1024
	MaxWork         = 4 * MaxEncodedBytes
)

Variables

View Source
var (
	ErrDocument = errors.New("document: invalid size")
	ErrEncoding = errors.New("document: invalid UTF-8")
	ErrLimits   = errors.New("document: invalid limits")
	ErrProfile  = errors.New("document: unsupported profile")
	ErrVersion  = errors.New("document: unsupported version")
)

Functions

This section is empty.

Types

type Limits

type Limits struct {
	MaxEncodedBytes      int
	MaxNodes             int
	MaxDepth             int
	MaxAttributesPerNode int
	MaxStyleDeclarations int
	MaxTextBytes         int
	MaxAssetBytes        int
	MaxWork              int
}

Limits bounds parser, style, layout, and asset work. V2-04 selects the measured values; transports always enforce MaxEncodedBytes first.

func DashboardLimits

func DashboardLimits() Limits

func (Limits) Validate

func (l Limits) Validate() error

type Profile

type Profile uint8
const ProfileDashboard Profile = 1

type Source

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

Source borrows one caller-owned UTF-8 HTML byte slice. The caller keeps it stable until parsing and rendering finish.

func NewSource

func NewSource(version Version, profile Profile, html []byte) (Source, error)

func (Source) HTML

func (s Source) HTML() []byte

func (Source) Profile

func (s Source) Profile() Profile

func (Source) Validate

func (s Source) Validate() error

func (Source) Version

func (s Source) Version() Version

type Version

type Version uint8
const Version1 Version = 1

Jump to

Keyboard shortcuts

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