Documentation
¶
Index ¶
- Variables
- type AssignNode
- type BinaryExpr
- type BuiltinFunc
- type CallExpr
- type Context
- type DMLInstruction
- type Element
- type ExecContext
- type Expr
- type ExprStmt
- type ForNode
- type GUIKit
- func (gk *GUIKit) Broadcast(event string, payload interface{})
- func (gk *GUIKit) Get(pattern string, handler func(c *Context))
- func (gk *GUIKit) GetGlobal(key string) (interface{}, bool)
- func (gk *GUIKit) GetGlobalMap() map[string]interface{}
- func (gk *GUIKit) GetNonce(r *http.Request) string
- func (gk *GUIKit) GetSession(id uint64) string
- func (gk *GUIKit) HandleWebSocket(w http.ResponseWriter, r *http.Request)
- func (gk *GUIKit) Post(pattern string, handler func(c *Context))
- func (gk *GUIKit) RegisterComponent(comp LiveComponent)
- func (gk *GUIKit) Render(c *Context, viewPath string)
- func (gk *GUIKit) Run()
- func (gk *GUIKit) SecureHeaders(next http.HandlerFunc) http.HandlerFunc
- func (gk *GUIKit) SetGlobal(key string, value interface{})
- func (gk *GUIKit) SetSession(id uint64, key string, value string) error
- type IfNode
- type IncomingEvent
- type LiteralExpr
- type LiveComponent
- type Node
- type OutgoingPatch
- type Parser
- type ReturnNode
- type ScriptBlock
- type ScriptComponent
- type ScriptNode
- type ScriptParser
- type SessionRecord
- type Text
- type ThreadSafeConn
- type UserFunction
- type VariableExpr
Constants ¶
This section is empty.
Variables ¶
View Source
var AppFS fs.FS
Functions ¶
This section is empty.
Types ¶
type AssignNode ¶ added in v1.1.3
func (AssignNode) Execute ¶ added in v1.1.3
func (an AssignNode) Execute(ctx *ExecContext) error
type BinaryExpr ¶ added in v1.1.3
func (BinaryExpr) Eval ¶ added in v1.1.3
func (be BinaryExpr) Eval(ctx *ExecContext) interface{}
type BuiltinFunc ¶ added in v1.1.3
type BuiltinFunc func(ctx *ExecContext, args []interface{}) (interface{}, error)
type CallExpr ¶ added in v1.1.3
func (CallExpr) Eval ¶ added in v1.1.3
func (ce CallExpr) Eval(ctx *ExecContext) interface{}
type DMLInstruction ¶ added in v1.1.3
type ExecContext ¶ added in v1.1.3
type ExecContext struct {
Component *ScriptComponent
Payload map[string]string
Locals map[string]interface{}
DB *ultimate_db.DB
ORM *ultimate_db.ORM
DMLActions []DMLInstruction
}
func (*ExecContext) ResolvePath ¶ added in v1.1.3
func (ctx *ExecContext) ResolvePath(path string) interface{}
func (*ExecContext) SetPath ¶ added in v1.1.3
func (ctx *ExecContext) SetPath(path string, val interface{})
type Expr ¶ added in v1.1.3
type Expr interface {
Eval(ctx *ExecContext) interface{}
}
type ExprStmt ¶ added in v1.2.1
type ExprStmt struct{ Expression Expr }
func (ExprStmt) Execute ¶ added in v1.2.1
func (es ExprStmt) Execute(ctx *ExecContext) error
type ForNode ¶ added in v1.1.3
type ForNode struct {
IteratorKey string
IterableKey string
Body []ScriptNode
}
func (ForNode) Execute ¶ added in v1.1.3
func (fn ForNode) Execute(ctx *ExecContext) error
type GUIKit ¶
type GUIKit struct {
DB *ultimate_db.DB
ORM *ultimate_db.ORM
Mux *http.ServeMux
// contains filtered or unexported fields
}
func New ¶
func New(db *ultimate_db.DB, orm *ultimate_db.ORM) (*GUIKit, error)
func (*GUIKit) GetGlobalMap ¶
func (*GUIKit) GetSession ¶
func (*GUIKit) HandleWebSocket ¶
func (gk *GUIKit) HandleWebSocket(w http.ResponseWriter, r *http.Request)
func (*GUIKit) RegisterComponent ¶
func (gk *GUIKit) RegisterComponent(comp LiveComponent)
func (*GUIKit) SecureHeaders ¶
func (gk *GUIKit) SecureHeaders(next http.HandlerFunc) http.HandlerFunc
type IfNode ¶ added in v1.1.3
type IfNode struct {
Condition Expr
Body []ScriptNode
ElseBody []ScriptNode
}
func (IfNode) Execute ¶ added in v1.1.3
func (in IfNode) Execute(ctx *ExecContext) error
type IncomingEvent ¶
type LiteralExpr ¶ added in v1.1.3
type LiteralExpr struct{ Value interface{} }
func (LiteralExpr) Eval ¶ added in v1.1.3
func (le LiteralExpr) Eval(ctx *ExecContext) interface{}
type LiveComponent ¶
type OutgoingPatch ¶
type ReturnNode ¶ added in v1.1.3
type ReturnNode struct{ Expression Expr }
func (ReturnNode) Execute ¶ added in v1.1.3
func (rn ReturnNode) Execute(ctx *ExecContext) error
type ScriptBlock ¶ added in v1.1.3
type ScriptBlock struct{ Statements []ScriptNode }
type ScriptComponent ¶ added in v1.1.3
type ScriptComponent struct {
Id string
GmlPath string
ScriptPath string
State map[string]interface{}
Handlers map[string]*ScriptBlock
Functions map[string]UserFunction
Db *ultimate_db.DB
Orm *ultimate_db.ORM
// contains filtered or unexported fields
}
func LoadScriptComponent ¶ added in v1.1.6
func LoadScriptComponent(gk *GUIKit, id string, viewPath string) (*ScriptComponent, error)
func (*ScriptComponent) ID ¶ added in v1.1.3
func (sc *ScriptComponent) ID() string
func (*ScriptComponent) InvokeEvent ¶ added in v1.1.3
func (sc *ScriptComponent) InvokeEvent(name string, data map[string]string) ([]DMLInstruction, error)
func (*ScriptComponent) Render ¶ added in v1.1.3
func (sc *ScriptComponent) Render() string
type ScriptNode ¶ added in v1.1.3
type ScriptNode interface {
Execute(ctx *ExecContext) error
}
type ScriptParser ¶ added in v1.1.3
type ScriptParser struct {
// contains filtered or unexported fields
}
func NewScriptParser ¶ added in v1.1.3
func NewScriptParser(src string) *ScriptParser
func (*ScriptParser) Parse ¶ added in v1.1.3
func (p *ScriptParser) Parse(sc *ScriptComponent, namespace string) error
func (*ScriptParser) TokenText ¶ added in v1.2.2
func (p *ScriptParser) TokenText() string
type SessionRecord ¶
type ThreadSafeConn ¶
type ThreadSafeConn struct {
// contains filtered or unexported fields
}
func (*ThreadSafeConn) Close ¶
func (s *ThreadSafeConn) Close() error
func (*ThreadSafeConn) WriteJSON ¶
func (s *ThreadSafeConn) WriteJSON(v interface{}) error
func (*ThreadSafeConn) WriteMessage ¶
func (s *ThreadSafeConn) WriteMessage(messageType int, data []byte) error
type UserFunction ¶ added in v1.1.3
type UserFunction struct {
Params []string
Body []ScriptNode
}
type VariableExpr ¶ added in v1.1.3
type VariableExpr struct{ Path string }
func (VariableExpr) Eval ¶ added in v1.1.3
func (ve VariableExpr) Eval(ctx *ExecContext) interface{}
Click to show internal directories.
Click to hide internal directories.