Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Register ¶
func Register(typ Type, f FactoryFunc) error
func Unregister ¶
Types ¶
type Engine ¶
type Engine interface {
Init(ctx context.Context) error
Destroy() error
IsInitialized() bool
LoadString(ctx context.Context, source string) error
LoadFile(ctx context.Context, filePath string) error
LoadReader(ctx context.Context, reader io.Reader, name string) error
Execute(ctx context.Context) (any, error)
ExecuteString(ctx context.Context, source string) (any, error)
ExecuteFile(ctx context.Context, filePath string) (any, error)
RegisterGlobal(name string, value any) error
GetGlobal(name string) (any, error)
RegisterFunction(name string, fn any) error
CallFunction(ctx context.Context, name string, args ...any) (any, error)
RegisterModule(name string, module any) error
GetLastError() error
ClearError()
}
Engine Define the interface for script engines
type ExecuteOptions ¶
ExecuteOptions 执行选项
type FactoryFunc ¶
func GetFactory ¶
func GetFactory(typ Type) (FactoryFunc, bool)
Click to show internal directories.
Click to hide internal directories.