baseobject

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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")
	//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")
)

Functions

func Discover

func Discover(obj js.Value) (interface{}, error)

func Eval

func Eval(str string) (js.Value, error)

func GoValue

func GoValue(object js.Value) interface{}

func Register

func Register(inter js.Value, contruct func(js.Value) (interface{}, error)) error

func String

func String(object js.Value) string

func ToStringWithErr

func ToStringWithErr(object js.Value) (string, error)

String return the string javascript value represent the object

Types

type BaseObject

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

func NewFromJSObject

func NewFromJSObject(obj js.Value) (BaseObject, error)

func (BaseObject) CallBool

func (o BaseObject) CallBool(method string) (bool, error)

func (BaseObject) CallInt64

func (o BaseObject) CallInt64(method string) (int64, error)

func (BaseObject) Export

func (o BaseObject) Export(name string)

func (BaseObject) GetAttributeBool

func (o BaseObject) GetAttributeBool(attribute string) (bool, error)

func (BaseObject) GetAttributeDouble

func (o BaseObject) GetAttributeDouble(attribute string) (float64, error)

func (BaseObject) GetAttributeGlobal

func (o BaseObject) GetAttributeGlobal(attribute string) (interface{}, error)

func (BaseObject) GetAttributeInt

func (o BaseObject) GetAttributeInt(attribute string) (int, error)

func (BaseObject) GetAttributeString

func (o BaseObject) GetAttributeString(attribute string) (string, error)

func (BaseObject) JSObject

func (o BaseObject) JSObject() js.Value

func (BaseObject) Length

func (o BaseObject) Length() int

func (BaseObject) SetAttributeBool

func (o BaseObject) SetAttributeBool(attribute string, value bool) error

func (BaseObject) SetAttributeDouble

func (o BaseObject) SetAttributeDouble(attribute string, value float64) error

func (BaseObject) SetAttributeInt

func (o BaseObject) SetAttributeInt(attribute string, value int) error

func (BaseObject) SetAttributeString

func (o BaseObject) SetAttributeString(attribute string, value string) error

func (BaseObject) SetObject

func (o BaseObject) SetObject(object js.Value) BaseObject

func (BaseObject) String

func (o BaseObject) String() string

func (BaseObject) ToString

func (o BaseObject) ToString() (string, error)

func (BaseObject) Value

func (o BaseObject) Value() string

type ObjectFrom

type ObjectFrom interface {
	JSObject() js.Value
}

Jump to

Keyboard shortcuts

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