builtin

package
v0.0.0-...-d401e3c Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBuiltins

func GetBuiltins() map[string]Function

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

type Package

type Package interface {
	// Execute runs a function in the package
	Execute(fn string, args []*Variable) (*FuncReturn, error)
	// Access gets a constant variable from the package
	Access(variable string) (*Variable, error)
}

Package is a package that can be used in the language

type Variable

type Variable struct {
	Type  tokens.VariableType
	Value any
}

Variable is a runtime variable that can be used in the language

func (*Variable) String

func (v *Variable) String() string

Jump to

Keyboard shortcuts

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