idbblob

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2022 License: Apache-2.0 Imports: 6 Imported by: 3

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

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

Blob is a blob.Blob for JS environments, optimized for reading and writing to a Uint8Array without en/decoding back and forth.

func FromBlob

func FromBlob(b blob.Blob) *Blob

FromBlob creates a Blob from the given blob.Blob, either wrapping the JS value or copying the bytes if incompatible.

func New

func New(buf js.Value) (_ *Blob, returnedErr error)

New creates a Blob wrapping the given JS Uint8Array buffer.

func NewLength

func NewLength(length int) (_ *Blob, err error)

NewLength creates a zero-value Blob with 'length' bytes.

func (*Blob) Bytes

func (b *Blob) Bytes() []byte

Bytes implememts blob.Blob

func (*Blob) Grow

func (b *Blob) Grow(off int64) error

Grow implements blob.GrowBlob

func (*Blob) JSValue

func (b *Blob) JSValue() js.Value

JSValue implements js.Wrapper

func (*Blob) Len

func (b *Blob) Len() int

Len implements blob.Blob

func (*Blob) Set

func (b *Blob) Set(src blob.Blob, destStart int64) (n int, err error)

Set implements blob.SetBlob

func (*Blob) Slice

func (b *Blob) Slice(start, end int64) (blob.Blob, error)

Slice implements blob.SliceBlob

func (*Blob) Truncate

func (b *Blob) Truncate(size int64) error

Truncate implements TruncateBlob

func (*Blob) View

func (b *Blob) View(start, end int64) (blob.Blob, error)

View implements blob.ViewBlob

Jump to

Keyboard shortcuts

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