gox

package module
v0.0.31 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 9 Imported by: 1

README

GoX — JSX for Go

  • Introduces HTML syntax as a first-class Go expression.
  • LSP-first: proxies gopls with additional capabilities; works on the fly with no extra commands.
  • Compiles HTML into a stream of meaningful jobs, enabling mid-render mutation for extreme flexibility.
  • Compatible with templ.

Status

Work in progress. Not yet available.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Release added in v0.0.5

func Release(r Releaser)

Types

type Attr

type Attr = *attr

func (Attr) Append

func (a Attr) Append(value string)

func (Attr) AppendObject

func (a Attr) AppendObject(value any)

func (Attr) IsSet

func (a Attr) IsSet() bool

func (Attr) Name

func (a Attr) Name() string

func (Attr) ReadBool

func (a Attr) ReadBool() (bool, bool)

func (Attr) ReadObject

func (a Attr) ReadObject() (any, bool)

func (Attr) ReadObjectArray

func (a Attr) ReadObjectArray() ([]any, bool)

func (Attr) ReadString

func (a Attr) ReadString() (string, bool)

func (Attr) Render

func (a Attr) Render(w io.Writer) error

func (Attr) Set

func (a Attr) Set(value string)

func (Attr) SetBool

func (a Attr) SetBool(value bool)

func (Attr) SetObject

func (a Attr) SetObject(value any)

type AttrMod added in v0.0.4

type AttrMod interface {
	Modify(ctx context.Context, tag string, attrs Attrs) error
}

type Attrs

type Attrs = *attrs

func NewAttrs

func NewAttrs() Attrs

func (Attrs) AddMod added in v0.0.12

func (a Attrs) AddMod(m AttrMod)

func (Attrs) ApplyMods added in v0.0.14

func (a Attrs) ApplyMods(ctx context.Context, tag string) error

func (Attrs) Clone

func (a Attrs) Clone() Attrs

func (Attrs) Get

func (a Attrs) Get(name string) Attr

func (Attrs) Has added in v0.0.31

func (a Attrs) Has(name string) bool

func (Attrs) Inherit added in v0.0.23

func (a Attrs) Inherit(attrs Attrs)

func (Attrs) List

func (a Attrs) List() []Attr

type Comp

type Comp interface {
	Main() Elem
}

type Context

type Context = context.Context

type Cursor

type Cursor = *cursor

func NewCursor

func NewCursor(ctx context.Context, printer Printer) Cursor

func (Cursor) Any added in v0.0.7

func (c Cursor) Any(any any) error

func (Cursor) AttrAppend

func (c Cursor) AttrAppend(name string, value string) error

func (Cursor) AttrAppendObject

func (c Cursor) AttrAppendObject(name string, value any) error

func (Cursor) AttrMod

func (c Cursor) AttrMod(mods ...AttrMod) error

func (Cursor) AttrSet

func (c Cursor) AttrSet(name string, value string) error

func (Cursor) AttrSetAny

func (c Cursor) AttrSetAny(name string, value any) error

func (Cursor) AttrSetBool

func (c Cursor) AttrSetBool(name string, value bool) error

func (Cursor) AttrSetObject

func (c Cursor) AttrSetObject(name string, value any) error

func (Cursor) Bytes added in v0.0.21

func (c Cursor) Bytes(data []byte) error

func (Cursor) Close added in v0.0.7

func (c Cursor) Close() error

func (Cursor) Comp added in v0.0.7

func (c Cursor) Comp(comp Comp) error

func (Cursor) CompCtx added in v0.0.12

func (c Cursor) CompCtx(ctx context.Context, comp Comp) error

func (Cursor) Context added in v0.0.19

func (c Cursor) Context() context.Context

func (Cursor) Editor added in v0.0.26

func (c Cursor) Editor(editor Editor) error

func (Cursor) Fprint added in v0.0.7

func (c Cursor) Fprint(any any) error

func (Cursor) Func added in v0.0.7

func (c Cursor) Func(f func(w io.Writer) error) error

func (Cursor) Init added in v0.0.7

func (c Cursor) Init(tag string) error

func (Cursor) InitContainer added in v0.0.12

func (c Cursor) InitContainer() error

func (Cursor) InitVoid added in v0.0.7

func (c Cursor) InitVoid(tag string) error

func (Cursor) Many added in v0.0.9

func (c Cursor) Many(many ...any) error

func (Cursor) NewID added in v0.0.22

func (c Cursor) NewID() uint64

func (Cursor) Noop added in v0.0.5

func (c Cursor) Noop(any)

func (Cursor) Raw added in v0.0.7

func (c Cursor) Raw(text string) error

func (Cursor) Send added in v0.0.27

func (c Cursor) Send(job Job) error

func (Cursor) Submit added in v0.0.7

func (c Cursor) Submit() error

func (Cursor) Templ added in v0.0.7

func (c Cursor) Templ(templ Templ) error

func (Cursor) TemplCtx added in v0.0.12

func (c Cursor) TemplCtx(ctx context.Context, templ Templ) error

func (Cursor) Text added in v0.0.7

func (c Cursor) Text(text string) error

type Editor added in v0.0.25

type Editor interface {
	Edit(cur Cursor) error
}

type Elem

type Elem func(cur Cursor) error

func (Elem) Main

func (e Elem) Main() Elem

func (Elem) Print

func (e Elem) Print(ctx context.Context, printer Printer) error

func (Elem) Render

func (e Elem) Render(ctx context.Context, w io.Writer) error

type Error added in v0.0.20

type Error string

func (Error) Error added in v0.0.20

func (e Error) Error() string

type HeadError

type HeadError string

func (HeadError) Error

func (e HeadError) Error() string

type HeadKind

type HeadKind int
const (
	KindContainer HeadKind = iota
	KindRegular
	KindVoid
)

func (HeadKind) IsVoid

func (k HeadKind) IsVoid() bool

type Job

type Job interface {
	Context() context.Context
	Output(w io.Writer) error
}

type JobBytes added in v0.0.21

type JobBytes struct {
	Ctx   context.Context
	Bytes []byte
}

func NewJobBytes added in v0.0.21

func NewJobBytes(ctx context.Context, b []byte) *JobBytes

func (*JobBytes) Context added in v0.0.21

func (j *JobBytes) Context() context.Context

func (*JobBytes) Output added in v0.0.21

func (j *JobBytes) Output(w io.Writer) error

type JobComp

type JobComp struct {
	Comp Comp
	Ctx  context.Context
}

func NewJobComp added in v0.0.8

func NewJobComp(ctx context.Context, comp Comp) *JobComp

func (*JobComp) Context

func (j *JobComp) Context() context.Context

func (*JobComp) Output

func (j *JobComp) Output(w io.Writer) error

type JobError

type JobError struct {
	Ctx context.Context
	Err error
}

func NewJobError added in v0.0.20

func NewJobError(ctx context.Context, err error) *JobError

func (*JobError) Context added in v0.0.20

func (j *JobError) Context() context.Context

func (*JobError) Output added in v0.0.20

func (j *JobError) Output(w io.Writer) error

type JobFprint

type JobFprint struct {
	Ctx context.Context
	Any any
}

func NewJobFprint added in v0.0.8

func NewJobFprint(ctx context.Context, v any) *JobFprint

func (*JobFprint) Context

func (j *JobFprint) Context() context.Context

func (*JobFprint) Output

func (j *JobFprint) Output(w io.Writer) error

type JobFunc

type JobFunc struct {
	Ctx  context.Context
	Func func(w io.Writer) error
}

func NewJobFunc added in v0.0.8

func NewJobFunc(ctx context.Context, fn func(w io.Writer) error) *JobFunc

func (*JobFunc) Context

func (j *JobFunc) Context() context.Context

func (*JobFunc) Output

func (j *JobFunc) Output(w io.Writer) error

type JobHeadClose

type JobHeadClose struct {
	ID   uint64
	Kind HeadKind
	Tag  string
	Ctx  context.Context
}

func NewJobHeadClose

func NewJobHeadClose(id uint64, kind HeadKind, tag string, ctx context.Context) *JobHeadClose

func (*JobHeadClose) Context

func (j *JobHeadClose) Context() context.Context

func (*JobHeadClose) Output

func (j *JobHeadClose) Output(w io.Writer) error

type JobHeadOpen

type JobHeadOpen struct {
	ID    uint64
	Kind  HeadKind
	Tag   string
	Ctx   context.Context
	Attrs Attrs
}

func NewJobHeadOpen

func NewJobHeadOpen(id uint64, kind HeadKind, tag string, ctx context.Context, attrs Attrs) *JobHeadOpen

func (*JobHeadOpen) Context

func (j *JobHeadOpen) Context() context.Context

func (*JobHeadOpen) Output

func (j *JobHeadOpen) Output(w io.Writer) error

type JobRaw

type JobRaw struct {
	Ctx  context.Context
	Text string
}

func NewJobRaw

func NewJobRaw(ctx context.Context, text string) *JobRaw

func (*JobRaw) Context

func (j *JobRaw) Context() context.Context

func (*JobRaw) Output

func (j *JobRaw) Output(w io.Writer) error

type JobTempl

type JobTempl struct {
	Ctx   context.Context
	Templ Templ
}

func NewJobTempl added in v0.0.8

func NewJobTempl(ctx context.Context, templ Templ) *JobTempl

func (*JobTempl) Context

func (j *JobTempl) Context() context.Context

func (*JobTempl) Output

func (j *JobTempl) Output(w io.Writer) error

type JobText

type JobText struct {
	Ctx  context.Context
	Text string
}

func NewJobText added in v0.0.8

func NewJobText(ctx context.Context, text string) *JobText

func (*JobText) Context

func (j *JobText) Context() context.Context

func (*JobText) Output

func (j *JobText) Output(w io.Writer) error

type Printer

type Printer interface {
	Send(j Job) error
}

func NewPrinter

func NewPrinter(w io.Writer) Printer

type Proxy

type Proxy interface {
	Proxy(cur Cursor, elem Elem) error
}

type Releaser added in v0.0.5

type Releaser interface {
	// contains filtered or unexported methods
}

type Templ

type Templ interface {
	Render(ctx context.Context, w io.Writer) error
}

Directories

Path Synopsis
cmd
gox command
internal
jsonrpc
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
Package jsonrpc2 is a minimal implementation of the JSON RPC 2 spec.
lsp

Jump to

Keyboard shortcuts

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