Documentation ¶
Index ¶
- func GetStructType[T any](nj *NucleiJS, args []goja.Value, index int, FuncSig string) T
- func GetStructTypeSafe[T any](nj *NucleiJS, args []goja.Value, index int, defaultValue T) T
- func LinkConstructor[T any](call goja.ConstructorCall, vm *goja.Runtime, obj T) *goja.Object
- type NucleiJS
- func (j *NucleiJS) GetArg(args []goja.Value, index int) any
- func (j *NucleiJS) GetArgSafe(args []goja.Value, index int, defaultValue any) any
- func (j *NucleiJS) HandleError(err error, msg ...string)
- func (j *NucleiJS) Require(expr bool, msg string)
- func (j *NucleiJS) Throw(format string, args ...interface{})
- func (j *NucleiJS) ThrowError(err error)
- type SQLResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetStructType ¶
GetStructType gets a type defined in go and passed as argument from goja runtime if not found throws error Donot use this unless you are accepting a struct type from constructor
func GetStructTypeSafe ¶
GetStructTypeSafe gets an type defined in go and passed as argument from goja runtime if not found returns default value Donot use this unless you are accepting a struct type from constructor
func LinkConstructor ¶
LinkConstructor links a type with invocation doing this allows usage of instance of type in js
Types ¶
type NucleiJS ¶
type NucleiJS struct { ObjectSig string // contains filtered or unexported fields }
NucleiJS is js bindings that handles goja runtime related issue and allows setting a defer statements to close resources
func NewNucleiJS ¶
NewNucleiJS creates a new nucleijs instance
func (*NucleiJS) GetArg ¶
GetArg returns argument at index from goja runtime if not found throws error
func (*NucleiJS) GetArgSafe ¶
GetArgSafe returns argument at index from goja runtime if not found returns default value
func (*NucleiJS) HandleError ¶
HandleError handles error and throws a
func (*NucleiJS) ThrowError ¶
ThrowError throws an error in goja runtime if is not nil
type SQLResult ¶
type SQLResult struct { Count int // Count is the number of rows returned. Columns []string // Columns is the slice of column names. Rows []interface{} // Rows is a slice of row data, where each row is a map of column name to value. }
SQLResult holds the result of a SQL query.
It contains the count of rows, the columns present, and the actual row data.
func UnmarshalSQLRows ¶
UnmarshalSQLRows converts sql.Rows into a more structured SQLResult.
This function takes *sql.Rows as input and attempts to unmarshal the data into a SQLResult struct. It handles different SQL data types by using the appropriate sql.Null* types during scanning. It returns a pointer to a SQLResult or an error.
The function closes the sql.Rows when finished.