bridge

package
v0.0.0-...-d58ffde Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidJSError = NewJSTypeError("TypeError", "invalid js error")
View Source
var (
	ErrNotPromise = NewJSTypeError("PromiseError", "not a valid promise")
)

Functions

func Falsey

func Falsey(input js.Value) bool

func FromJsError

func FromJsError(v js.Value) (err error)

func IsNullish

func IsNullish(input js.Value) bool

func IsString

func IsString(input js.Value) bool

func ResolvePromise

func ResolvePromise(promise js.Value) (result *js.Value, err *js.Value, goErr error)

func ToJsError

func ToJsError(v error) js.Value

func ToJsTypeError

func ToJsTypeError(v error) js.Value

Types

type IConsole

type IConsole interface {
	Log(args ...interface{})
	Debug(args ...interface{})
	Info(args ...interface{})
	Warn(args ...interface{})
	Error(args ...interface{})
	Dir(data interface{})
	DirXML(data interface{})
}

func Console

func Console() IConsole

type JSConsole

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

func NewGlobalConsole

func NewGlobalConsole() *JSConsole

func (*JSConsole) Debug

func (c *JSConsole) Debug(args ...interface{})

func (*JSConsole) Dir

func (c *JSConsole) Dir(v interface{})

func (*JSConsole) DirXML

func (c *JSConsole) DirXML(v interface{})

func (*JSConsole) Error

func (c *JSConsole) Error(args ...interface{})

func (*JSConsole) Info

func (c *JSConsole) Info(args ...interface{})

func (*JSConsole) Log

func (c *JSConsole) Log(args ...interface{})

func (*JSConsole) Trace

func (c *JSConsole) Trace(args ...interface{})

func (*JSConsole) Warn

func (c *JSConsole) Warn(args ...interface{})

type JSError

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

func NewJSError

func NewJSError(name string, message string) JSError

func NewJSTypeError

func NewJSTypeError(name string, message string) JSError

func (JSError) Error

func (e JSError) Error() string

func (JSError) ToJS

func (e JSError) ToJS() js.Value

type MockLogger

type MockLogger struct{}

func (*MockLogger) Debug

func (l *MockLogger) Debug(args ...interface{})

func (*MockLogger) Dir

func (l *MockLogger) Dir(data interface{})

func (*MockLogger) DirXML

func (l *MockLogger) DirXML(data interface{})

func (*MockLogger) Error

func (l *MockLogger) Error(args ...interface{})

func (*MockLogger) Info

func (l *MockLogger) Info(args ...interface{})

func (*MockLogger) Log

func (l *MockLogger) Log(args ...interface{})

func (*MockLogger) Warn

func (l *MockLogger) Warn(args ...interface{})

Jump to

Keyboard shortcuts

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