Documentation ¶
Index ¶
- Variables
- func Call(obj js.Value, name string, args ...interface{}) (js.Value, error)
- func CopyBytesToGo(dst []byte, src js.Value) (int, error)
- func CopyBytesToJS(dst js.Value, src []byte) (int, error)
- func Discover(obj js.Value) (interface{}, error)
- func Eval(str string) (js.Value, error)
- func Get(obj js.Value, i interface{}) (js.Value, error)
- func GetFuncName(inter js.Value) (string, error)
- func GetIndex(obj js.Value, index int) (js.Value, error)
- func GetJsValueOf(i interface{}) js.Value
- func GoValue(object js.Value) (interface{}, error)
- func GoValue_(object js.Value) interface{}
- func Invoke(f js.Value, args ...interface{}) (js.Value, error)
- func New(obj js.Value, args ...interface{}) (js.Value, error)
- func Register(inter js.Value, contruct func(js.Value) (interface{}, error)) error
- func Self() (interface{}, error)
- func Set(obj js.Value, name string, val interface{}) error
- func SetConsoleDebug(obj interface{})
- func SetSyscall()
- func String(object js.Value) string
- func ToStringWithErr(object js.Value) (string, error)
- type BaseObject
- func (b BaseObject) BaseObject_() BaseObject
- func (b BaseObject) Bind(to BaseObject) (interface{}, error)
- func (b BaseObject) Call(name string, args ...interface{}) (js.Value, error)
- func (b BaseObject) CallBool(method string) (bool, error)
- func (b BaseObject) CallInt(method string) (int, error)
- func (b BaseObject) CallInt64(method string) (int64, error)
- func (b BaseObject) Class() (string, error)
- func (b BaseObject) Class_() string
- func (b BaseObject) ConstructName() (string, error)
- func (b BaseObject) ConstructName_() string
- func (b BaseObject) Debug(msg string) error
- func (b BaseObject) Discover() (interface{}, error)
- func (b BaseObject) Empty() bool
- func (b BaseObject) Export(name string)
- func (b BaseObject) Get(name string) (js.Value, error)
- func (b BaseObject) GetAttributeBool(attribute string) (bool, error)
- func (b BaseObject) GetAttributeDouble(attribute string) (float64, error)
- func (b BaseObject) GetAttributeGlobal(attribute string) (interface{}, error)
- func (b BaseObject) GetAttributeInt(attribute string) (int, error)
- func (b BaseObject) GetAttributeInt64(attribute string) (int64, error)
- func (b BaseObject) GetAttributeString(attribute string) (string, error)
- func (b BaseObject) GetAttributeString_(attribute string) string
- func (b BaseObject) GetIndex(index int) (js.Value, error)
- func (b BaseObject) Implement(method string) (bool, error)
- func (b BaseObject) JSObject() js.Value
- func (b BaseObject) Length() int
- func (b BaseObject) Set(name string, value interface{}) error
- func (b BaseObject) SetAttribute(attribute string, i interface{}) error
- func (b BaseObject) SetAttributeBool(attribute string, value bool) error
- func (b BaseObject) SetAttributeDouble(attribute string, value float64) error
- func (b BaseObject) SetAttributeInt(attribute string, value int) error
- func (b BaseObject) SetAttributeString(attribute string, value string) error
- func (b BaseObject) SetFunc(attribute string, f func(this js.Value, args []js.Value) interface{}) error
- func (b BaseObject) SetObject(object js.Value) BaseObject
- func (b BaseObject) String() string
- func (b BaseObject) ToString() (string, error)
- func (b BaseObject) ToString_() string
- func (b BaseObject) Value() string
- type ConsoleDebug
- type ObjectFrom
Constants ¶
This section is empty.
Variables ¶
var ( //ErrNotAnObject ErrNotAnObject error ErrNotAnObject = errors.New("The given value must be an object") //ErrObjectNotNumber ErrObjectNotNumber error ErrObjectNotNumber = errors.New("The given object is not a number") //ErrObjectNotDouble ErrObjectNotDouble error ErrObjectNotDouble = errors.New("The given object is not a double") //ErrObjectNotString ErrObjectNotString error ErrObjectNotString = errors.New("The given object is not a string") //ErrObjectNotBool ErrObjectNotBool error ErrObjectNotBool = errors.New("The given object is not boolean") //ErrNotAnMEv ErrNotAnMEv error ErrNotAnMEv = errors.New("The given value must be an Message Event") //ErrNotImplemented ErrNotImplemented error ErrNotImplemented = errors.New("Browser not implemented Object") //ErrNotImplemented ErrNotImplemented error ErrNotABaseObject = errors.New("Not a base object") //ErrUnableGetFunctName ErrUnableGetConstructName error ErrUnableGetFunctName = errors.New("Unable to get the func name") //ErrUnableGetConstruct ErrUnableGetConstruct error ErrUnableGetConstruct = errors.New("Unable to get the constructor") //ErrNotImplementedFunc ErrNotImplementedFunc error ErrNotImplementedFunc = errors.New("Function.prototype.apply was called on undefined, which is a undefined and not a function") //ErrUndefinedValue ErrUndefinedValue error ErrUndefinedValue = errors.New("Undefined value") )
Functions ¶
func Discover ¶
Discover Discover the Object Given and return a Hogosuru Class if the construct is registered
func GetJsValueOf ¶ added in v1.1.0
func SetConsoleDebug ¶
func SetConsoleDebug(obj interface{})
func SetSyscall ¶
func SetSyscall()
Types ¶
type BaseObject ¶
type BaseObject struct {
// contains filtered or unexported fields
}
BaseObject Base Object where all hogosuru herited from
func NewFromJSObject ¶
func NewFromJSObject(obj js.Value) (BaseObject, error)
NewFromJSObject Build a BaseObject from a Js Value Object given
func (BaseObject) BaseObject_ ¶
func (b BaseObject) BaseObject_() BaseObject
BaseObject_ Return the current BaseObject
func (BaseObject) Call ¶
func (b BaseObject) Call(name string, args ...interface{}) (js.Value, error)
Call
func (BaseObject) CallBool ¶
func (b BaseObject) CallBool(method string) (bool, error)
CallInt64 Call method given and return a bool int
func (BaseObject) CallInt ¶
func (b BaseObject) CallInt(method string) (int, error)
CallInt Call method given and return int
func (BaseObject) CallInt64 ¶
func (b BaseObject) CallInt64(method string) (int64, error)
CallInt64 Call method given and return a 64bit int
func (BaseObject) Class ¶
func (b BaseObject) Class() (string, error)
func (BaseObject) Class_ ¶
func (b BaseObject) Class_() string
func (BaseObject) ConstructName ¶
func (b BaseObject) ConstructName() (string, error)
ConstructName Get the construct name
func (BaseObject) ConstructName_ ¶
func (b BaseObject) ConstructName_() string
func (BaseObject) Debug ¶
func (b BaseObject) Debug(msg string) error
func (BaseObject) Discover ¶
func (b BaseObject) Discover() (interface{}, error)
Discover Use Discover of this struct
func (BaseObject) Empty ¶
func (b BaseObject) Empty() bool
Empty check if the struct is an empty Struct or have a JS Value attached
func (BaseObject) Export ¶
func (b BaseObject) Export(name string)
func (BaseObject) Get ¶
func (b BaseObject) Get(name string) (js.Value, error)
Get Get Value of object and handle err
func (BaseObject) GetAttributeBool ¶
func (b BaseObject) GetAttributeBool(attribute string) (bool, error)
func (BaseObject) GetAttributeDouble ¶
func (b BaseObject) GetAttributeDouble(attribute string) (float64, error)
func (BaseObject) GetAttributeGlobal ¶
func (b BaseObject) GetAttributeGlobal(attribute string) (interface{}, error)
func (BaseObject) GetAttributeInt ¶
func (b BaseObject) GetAttributeInt(attribute string) (int, error)
func (BaseObject) GetAttributeInt64 ¶
func (b BaseObject) GetAttributeInt64(attribute string) (int64, error)
func (BaseObject) GetAttributeString ¶
func (b BaseObject) GetAttributeString(attribute string) (string, error)
func (BaseObject) GetAttributeString_ ¶
func (b BaseObject) GetAttributeString_(attribute string) string
func (BaseObject) GetIndex ¶
func (b BaseObject) GetIndex(index int) (js.Value, error)
Get Get Value of object and handle err
func (BaseObject) Implement ¶
func (b BaseObject) Implement(method string) (bool, error)
Implement Check if the stuct implement a given name method
func (BaseObject) JSObject ¶
func (b BaseObject) JSObject() js.Value
JSObject Give the JS Value Object attach to this struct
func (BaseObject) Length ¶
func (b BaseObject) Length() int
Length Length of the JS.Value attached of this strict
func (BaseObject) Set ¶
func (b BaseObject) Set(name string, value interface{}) error
Set Set Value of object and handle err
func (BaseObject) SetAttribute ¶
func (b BaseObject) SetAttribute(attribute string, i interface{}) error
func (BaseObject) SetAttributeBool ¶
func (b BaseObject) SetAttributeBool(attribute string, value bool) error
func (BaseObject) SetAttributeDouble ¶
func (b BaseObject) SetAttributeDouble(attribute string, value float64) error
func (BaseObject) SetAttributeInt ¶
func (b BaseObject) SetAttributeInt(attribute string, value int) error
func (BaseObject) SetAttributeString ¶
func (b BaseObject) SetAttributeString(attribute string, value string) error
func (BaseObject) SetObject ¶
func (b BaseObject) SetObject(object js.Value) BaseObject
SetObject Set the JS value Object to this struct
func (BaseObject) String ¶
func (b BaseObject) String() string
String Get the current string representation of the js Value attached to this struct
func (BaseObject) ToString ¶
func (b BaseObject) ToString() (string, error)
ToString Get the current toString representation of the js Value attached to this struct
func (BaseObject) ToString_ ¶
func (b BaseObject) ToString_() string
type ConsoleDebug ¶
type ConsoleDebug interface {
Debug(opts ...interface{}) error
}
type ObjectFrom ¶
type ObjectFrom interface { JSObject() js.Value BaseObject_() BaseObject }
ObjectFrom Interface to check if Object is a BaseObject