array

package
v0.0.0-...-6e88d74 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ERR_ARRAY_UNSUPPORTED = errors.New("Array unsupported")

Functions

func GetGlobalArrayJSValue

func GetGlobalArrayJSValue(type_ ArrayType) (js.Value, error)

Types

type Array

type Array struct {
	JSValue js.Value
}

func NewArray

func NewArray(
	array_type ArrayType,
	length_typedArray_object_or_buffer js.Value,
	byteOffset *js.Value,
	length *js.Value,
) (self *Array, err error)

func NewArrayFromByteSlice

func NewArrayFromByteSlice(data []byte) (self *Array, err error)

func NewArrayFromJSValue

func NewArrayFromJSValue(value js.Value) (self *Array, err error)

func (*Array) GetU8Bytes

func (self *Array) GetU8Bytes() ([]byte, error)

func (*Array) Length

func (self *Array) Length() int

func (*Array) ToString

func (self *Array) ToString() string

func (*Array) Type

func (self *Array) Type() (t ArrayType, ok bool)

type ArrayType

type ArrayType string
const (
	ArrayTypeArray        ArrayType = "Array"
	ArrayTypeInt8         ArrayType = "Int8Array"
	ArrayTypeUint8        ArrayType = "Uint8Array"
	ArrayTypeUint8Clamped ArrayType = "Uint8ClampedArray"
	ArrayTypeInt16        ArrayType = "Int16Array"
	ArrayTypeUint16       ArrayType = "Uint16Array"
	ArrayTypeInt32        ArrayType = "Int32Array"
	ArrayTypeUint32       ArrayType = "Uint32Array"
	ArrayTypeFloat32      ArrayType = "Float32Array"
	ArrayTypeFloat64      ArrayType = "Float64Array"
	ArrayTypeBigInt64     ArrayType = "BigInt64Array"
	ArrayTypeBigUint64    ArrayType = "BigUint64Array"
)

func DetermineArrayType

func DetermineArrayType(v js.Value) (ret ArrayType, ok bool)

func (ArrayType) String

func (self ArrayType) String() string

Jump to

Keyboard shortcuts

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