Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetBuiltins ¶
GetBuiltins returns the built-in functions
Types ¶
type FuncReturn ¶
type FuncReturn struct { Type tokens.VariableType Value any }
FuncReturn is a return value from a function
type Function ¶
type Function func(args []*Variable) (*FuncReturn, error)
Function is a function that can be used in the language
type HtmlModule ¶
type HtmlModule struct {
// contains filtered or unexported fields
}
HtmlModule is a struct responsible for generating HTML content using an existing HttpModule.
func NewHtmlModule ¶
func NewHtmlModule(hm *HttpModule) *HtmlModule
NewHtmlModule creates and returns a new instance of HtmlModule using the provided HttpModule.
func (*HtmlModule) Access ¶
func (hm *HtmlModule) Access(variable string) (*Variable, error)
Access handles the retrieval of variables (not used in this case).
func (*HtmlModule) Execute ¶
func (hm *HtmlModule) Execute(fn string, args []*Variable) (*FuncReturn, error)
Execute performs the requested HTML function like 'doc', 'head', 'body', etc.
type HttpModule ¶
type HttpModule struct { // StatusCode is the HTTP status code StatusCode int // Body is the body of the request Body bytes.Buffer // contains filtered or unexported fields }
HttpModule is a module for handling HTTP requests
func NewHttpModule ¶
func NewHttpModule(w http.ResponseWriter, r *http.Request) *HttpModule
NewHttpModule creates a new instance of HttpModule
func (*HttpModule) Access ¶
func (hm *HttpModule) Access(variable string) (*Variable, error)
Access checks for a variable in the HttpModule (not used in your code, so it returns an error)
func (*HttpModule) Execute ¶
func (hm *HttpModule) Execute(fn string, args []*Variable) (*FuncReturn, error)
Execute runs the function passed as `fn` on the HttpModule