v8

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExitContext

func ExitContext(c *capi.CV8contextT) error

Types

type Context

type Context struct {
	V8context *capi.CV8contextT
	Global    Value
	Document  Value
}

func EnterContext

func EnterContext(c *capi.CV8contextT) (ctx Context, err error)

func GetCurrentContext

func GetCurrentContext() (c Context, err error)

func GetV8Context

func GetV8Context(v8c *capi.CV8contextT) (c Context, err error)

func (Context) Alertf

func (c Context) Alertf(message string, v ...interface{}) (err error)

func (Context) Eval

func (c Context) Eval(code string) (v Value, err error)

func (Context) GetBrowser

func (c Context) GetBrowser() *capi.CBrowserT

func (Context) GetElementById

func (c Context) GetElementById(id string) (value Value, err error)

func (Context) GetElementsByClassName

func (c Context) GetElementsByClassName(cls string) (elements Value, err error)

func (Context) GetFrame

func (c Context) GetFrame() *capi.CFrameT

func (Context) IsSame

func (c Context) IsSame(c1 Context) bool

func (Context) IsValid

func (c Context) IsValid() bool

func (Context) NewArray

func (c Context) NewArray(elems ...Value) Value

type EventHandlerFunc

type EventHandlerFunc func(object Value, event Value) error

func (EventHandlerFunc) Execute

func (f EventHandlerFunc) Execute(self *capi.CV8handlerT,
	name string,
	object *capi.CV8valueT,
	arguments []*capi.CV8valueT,
) (sts bool, retval *capi.CV8valueT, exception string)

type EventType

type EventType string
const (
	EventCancel EventType = "cancel"
	EventClick  EventType = "click"
	EventClose  EventType = "close"
	EventSubmit EventType = "submit"
)

type Function

type Function Value

func (Function) ExecuteFunction

func (f Function) ExecuteFunction(object Value, args []Value) (val Value, err error)

func (Function) ExecuteFunctionWithContext

func (f Function) ExecuteFunctionWithContext(context Context, object Value, args []Value) (val Value, err error)

type HandlerFunction

type HandlerFunction func(this Value, args []Value) (v Value, err error)

func (HandlerFunction) Execute

func (f HandlerFunction) Execute(
	self *capi.CV8handlerT,
	name string,
	thisObject *capi.CV8valueT,
	arguments []*capi.CV8valueT,
) (sts bool, retval *capi.CV8valueT, exception string)

type Value

type Value struct {
	// contains filtered or unexported fields
}

func CreateBool

func CreateBool(b bool) (v Value)

func CreateInt

func CreateInt(i int) Value

func CreateString

func CreateString(s string) Value

func CreateStringFromByteArray

func CreateStringFromByteArray(b []byte) Value

func NewFunction

func NewFunction(name string, f capi.CV8handlerTExecuteHandler) Value

func NewObject

func NewObject() Value

func NewString

func NewString(s string) Value

func NewValue

func NewValue(v8v *capi.CV8valueT) Value

func (Value) AddEventListener

func (v Value) AddEventListener(e EventType, h capi.CV8handlerTExecuteHandler) (err error)

func (Value) Call

func (v Value) Call(name string, args []Value) (r Value, e error)

func (Value) CapiValue

func (v Value) CapiValue() *capi.CV8valueT

func (Value) ClearException

func (v Value) ClearException() bool

func (Value) DeleteValueByindex

func (v Value) DeleteValueByindex(index int, value Value) (err error)

func (Value) DeleteValueBykey

func (v Value) DeleteValueBykey(key string, value Value) (err error)

func (Value) ExecuteFunction

func (f Value) ExecuteFunction(this Value, args []Value) (r Value, e error)

func (Value) ExecuteFunctionWithContext

func (f Value) ExecuteFunctionWithContext(context Context, this Value, args []Value) (r Value, e error)

func (Value) GetBoolValue

func (v Value) GetBoolValue() bool

func (Value) GetDateValue

func (v Value) GetDateValue() capi.CBasetimeT

func (Value) GetDoubleValue

func (v Value) GetDoubleValue() float64

func (Value) GetException

func (v Value) GetException() *capi.CV8exceptionT

func (Value) GetIntValue

func (v Value) GetIntValue() int

func (Value) GetStringValue

func (v Value) GetStringValue() string

func (Value) GetUintValue

func (v Value) GetUintValue() uint

func (Value) GetValueByindex

func (v Value) GetValueByindex(index int) (rv Value, err error)

func (Value) GetValueBykey

func (v Value) GetValueBykey(key string) (rv Value, err error)

func (Value) HasException

func (v Value) HasException() bool

func (Value) HasOneRef

func (v Value) HasOneRef() bool

func (Value) HasValueBykey

func (v Value) HasValueBykey(key string) bool

func (Value) IsArray

func (v Value) IsArray() bool

func (Value) IsArrayBuffer

func (v Value) IsArrayBuffer() bool

func (Value) IsBool

func (v Value) IsBool() bool

func (Value) IsDate

func (v Value) IsDate() bool

func (Value) IsDouble

func (v Value) IsDouble() bool

func (Value) IsFunction

func (v Value) IsFunction() bool

func (Value) IsInt

func (v Value) IsInt() bool

func (Value) IsNil

func (v Value) IsNil() bool

func (Value) IsNull

func (v Value) IsNull() bool

func (Value) IsObject

func (v Value) IsObject() bool

func (Value) IsSame

func (v Value) IsSame(v1 Value) bool

func (Value) IsString

func (v Value) IsString() bool

func (Value) IsUndefined

func (v Value) IsUndefined() bool

func (Value) IsUnt

func (v Value) IsUnt() bool

func (Value) IsValid

func (v Value) IsValid() bool

func (Value) SetValueByindex

func (v Value) SetValueByindex(index int, value Value) (err error)

func (Value) SetValueBykey

func (v Value) SetValueBykey(key string, value Value) (err error)

func (Value) SetValueBykeyWithAttribute

func (v Value) SetValueBykeyWithAttribute(key string, value Value, attribute capi.CV8PropertyattributeT) (err error)

func (Value) ToString

func (v Value) ToString() (s string, err error)

Jump to

Keyboard shortcuts

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