idbblob

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 5 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Rendered for js/wasm

Overview

Package idbblob contains a JavaScript implementation of blob.Blob.

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(unsafeBuf js.Value) (*Blob, error)

New creates a Blob wrapping the given JS Uint8Array buffer.

func NewLength

func NewLength(length int) (*Blob, 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 jswrapper.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