baseobject

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 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 SetConsoleDebug

func SetConsoleDebug(obj interface{})

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) BaseObject

func (b BaseObject) BaseObject() BaseObject

func (BaseObject) Bind

func (b BaseObject) Bind(to BaseObject) (interface{}, error)

func (BaseObject) CallBool

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

func (BaseObject) CallInt64

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

func (BaseObject) Class

func (b BaseObject) Class() (string, error)

func (BaseObject) Class_

func (o BaseObject) Class_() string

func (BaseObject) Debug

func (b BaseObject) Debug(msg string) error

func (BaseObject) Discover

func (b BaseObject) Discover() (interface{}, error)

func (BaseObject) Empty

func (b BaseObject) Empty() bool

func (BaseObject) Export

func (b BaseObject) Export(name string)

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) GetAttributeString

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

func (BaseObject) Implement

func (b BaseObject) Implement(method string) (bool, error)

func (BaseObject) JSObject

func (b BaseObject) JSObject() js.Value

func (BaseObject) Length

func (b BaseObject) Length() int

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) SetFunc

func (b BaseObject) SetFunc(attribute string, f func(this js.Value, args []js.Value) interface{}) error

func (BaseObject) SetObject

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

func (BaseObject) String

func (b BaseObject) String() string

func (BaseObject) ToString

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

func (BaseObject) Value

func (b BaseObject) Value() string

type ConsoleDebug

type ConsoleDebug interface {
	Debug(opts ...interface{}) error
}

type ObjectFrom

type ObjectFrom interface {
	JSObject() js.Value
	BaseObject() BaseObject
}

Jump to

Keyboard shortcuts

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