middleware

package
v0.0.0-...-3864442 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 28 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAuthHandler

func CheckAuthHandler(next echo.HandlerFunc) echo.HandlerFunc

func CheckRoleHandler

func CheckRoleHandler(next echo.HandlerFunc) echo.HandlerFunc

func GenerateStateHandler

func GenerateStateHandler(next echo.HandlerFunc) echo.HandlerFunc

Types

type JSVM

type JSVM struct {
	*eventloop.EventLoop
	// contains filtered or unexported fields
}

JSVM wraps goja EventLoop

func (*JSVM) Handle

func (r *JSVM) Handle(req map[string]interface{}) <-chan Resp

Handle handles http requests

type React

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

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

var ReactJS *React

func NewReact

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

NewReact initialized React struct

func (*React) Handle

func (r *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

Jump to

Keyboard shortcuts

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