Documentation
¶
Overview ¶
Package engines mirrors Illuminate\View\Engines.
The files it answers to, in the clone at laravel_illuminate/view/Engines:
CompilerEngine.php Engine.php EngineResolver.php FileEngine.php PhpEngine.php
Nothing is implemented here yet. docs/31-reorganizacao-hesape.md says what moves in, from where, and in which phase.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Base ¶
type Base struct {
// contains filtered or unexported fields
}
Base is the abstract Illuminate\View\Engines\Engine.
PHP's abstract class holds one field and one method: the view drawn last, which the exception message names. An engine embeds this to answer for it.
func (*Base) GetLastRendered ¶
GetLastRendered is Engine::getLastRendered.
type Compiler ¶
type Compiler struct {
Base
// contains filtered or unexported fields
}
Compiler is Illuminate\View\Engines\CompilerEngine.
In Arandu there is no runtime compilation on the hot path: the kyse compiler runs at build time and produces Go functions. What survives from PHP is the bookkeeping around it -- whether a path was already found current in this process, and which path is being drawn when something fails.
func NewCompiler ¶
func NewCompiler(compiler CompilerInterface, evaluate func(path string, data map[string]any) (string, error)) *Compiler
NewCompiler is CompilerEngine::__construct.
evaluate stands in for PhpEngine::evaluatePath, which has no counterpart: it exists because PHP includes the compiled file at request time, and a compiled view here is a Go function that was linked into the binary.
func (*Compiler) ForgetCompiledOrNotExpired ¶
func (c *Compiler) ForgetCompiledOrNotExpired()
ForgetCompiledOrNotExpired is CompilerEngine::forgetCompiledOrNotExpired.
func (*Compiler) GetCompiler ¶
func (c *Compiler) GetCompiler() CompilerInterface
GetCompiler is CompilerEngine::getCompiler.
type CompilerInterface ¶
type CompilerInterface interface {
// GetCompiledPath is Compiler::getCompiledPath.
GetCompiledPath(path string) string
// IsExpired is Compiler::isExpired.
IsExpired(path string) (bool, error)
// Compile is CompilerInterface::compile.
Compile(path string) error
}
CompilerInterface is Illuminate\View\Compilers\CompilerInterface.
The contract is declared where it is consumed rather than beside the implementation, which is what keeps view -> engines -> compilers -> view from closing into a cycle.
type Engine ¶
Engine mirrors Illuminate\View\Engines\Engine.
An Engine turns a view path and data into rendered content. In Arandu, views are compiled into Go functions by kyse at build time, so the engine delegates to the compiled function registry — there is no runtime compilation. The Engine interface exists to match the Illuminate surface.
type File ¶
type File struct {
Base
// contains filtered or unexported fields
}
File is Illuminate\View\Engines\FileEngine.
It reads a raw file from disk. In Arandu that is `aru view:build` reading a .kyse.go source before compiling it, never a request.
type Resolver ¶
type Resolver struct {
// contains filtered or unexported fields
}
Resolver mirrors Illuminate\View\Engines\EngineResolver.
It maps engine names to constructors. In Arandu, the only engine is the compiled kyse engine; this type preserves the Illuminate API surface for compatibility and future extension.
func NewResolver ¶
func NewResolver() *Resolver
NewResolver returns a resolver with no engines registered.