site

package
v0.0.0-...-2edc622 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type React

type React struct {
	Runtime
	// contains filtered or unexported fields
}

React struct is contains JS vms Runtime to serve HTTP requests and separates some domain specific resources.

func NewReact

func NewReact(ctx context.Context, filePath string, debug bool, proxy http.Handler) *React

NewReact initialized React struct

func (*React) Handle

func (that *React) Handle(c echo.Context) error

Handle handles all HTTP requests which have not been caught via static file handler or other middlewares.

type Resp

type Resp struct {
	UUID       string        `json:"uuid"`
	Error      string        `json:"error"`
	Redirect   string        `json:"redirect"`
	App        string        `json:"app"`
	Title      string        `json:"title"`
	Meta       string        `json:"meta"`
	Initial    string        `json:"initial"`
	RenderTime time.Duration `json:"-"`
}

Resp is a struct for convinient react app Response parsing. Feel free to add any other keys to this struct and return value for this key at ecmascript side. Keep it sync with: src/app/client/router/toString.js:23

func (Resp) HTMLApp

func (r Resp) HTMLApp() template.HTML

HTMLApp returns a application template

func (Resp) HTMLMeta

func (r Resp) HTMLMeta() template.HTML

HTMLMeta returns a meta data

func (Resp) HTMLTitle

func (r Resp) HTMLTitle() template.HTML

HTMLTitle returns a title data

type Runtime

type Runtime interface {
	Get() *v8
	Put(v8 *v8)
	Release(v8 *v8)
}

Runtime Interface to serve React app on demand or from prepared Runtime.

Jump to

Keyboard shortcuts

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