fx

package
v0.10.5 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2026 License: Unlicense Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attr

type Attr map[string]string

Attr is a map of HTML attribute key-value pairs passed to any element builder.

type Circuit added in v0.10.5

type Circuit struct {
	Routes map[string][]byte
}

func NewCircuit added in v0.10.5

func NewCircuit() *Circuit

func (*Circuit) Compress added in v0.10.5

func (c *Circuit) Compress(data []byte) []byte

Compress gzip-compresses data at maximum compression. Bundles are compressed once at build time and served directly with Content-Encoding: gzip.

func (*Circuit) Load added in v0.10.5

func (c *Circuit) Load(path string)

Load reads a file or directory at path, encodes and compresses the contents, and stores the bundle in Routes keyed by the base name of path. Raw data is freed from each Value after the bundle is stored.

func (*Circuit) ToBytes added in v0.10.5

func (c *Circuit) ToBytes(input string) ([]byte, error)

ToBytes fetches the content at input, either from an HTTP URL or a local file.

func (*Circuit) Wire added in v0.10.5

func (c *Circuit) Wire(values []*Value) []byte

type Forge

type Forge interface {
	HTML(raw string) *template.HTML
	Build(class string, elements ...*template.HTML)
	Builder(class string, elements ...*template.HTML) *template.HTML
	Frames(frame ...*template.HTML) [][]byte
	Markdown() *markdown.Markdown
	JS(path string) *template.HTML
	CSS(css string) *template.HTML
	Elem(tag, text string, attrs ...Attr) *template.HTML
	Block(tag string, attrs Attr, children ...*template.HTML) *template.HTML
	Void(tag string, attrs Attr) *template.HTML
}

func NewForge

func NewForge() Forge

type Fx

type Fx struct {
	*zero.Zero
	Forge
	*Circuit
}

func NewFx

func NewFx(z *zero.Zero) *Fx

type Value

type Value struct {
	Name string `json:"name,omitempty"`
	Type string `json:"type,omitempty"`
	Size uint32 `json:"size"`
	Data []byte `json:"-"`
}

Value is the unit of work for encoding. Name and Type populate the manifest; Data is the raw blob. Data is excluded from JSON and freed after encoding.

Jump to

Keyboard shortcuts

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