buffer

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ModuleName = "buffer"

Variables

This section is empty.

Functions

func Base64DecodeAppend

func Base64DecodeAppend(dst []byte, src string) ([]byte, error)

func Bytes

func Bytes(r *goja.Runtime, v goja.Value) []byte

func DecodeBytes

func DecodeBytes(r *goja.Runtime, arg, enc goja.Value) []byte

func Enable

func Enable(runtime *goja.Runtime)

func EncodeBytes

func EncodeBytes(r *goja.Runtime, data []byte, enc goja.Value) goja.Value

EncodeBytes returns the given byte slice encoded as string with the given encoding. If encoding is not specified or not supported, returns a Buffer that wraps the data.

func Require

func Require(runtime *goja.Runtime, module *goja.Object)

func WrapBytes

func WrapBytes(r *goja.Runtime, data []byte) *goja.Object

Types

type Buffer

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

func GetApi

func GetApi(r *goja.Runtime) *Buffer

func (*Buffer) WrapBytes

func (b *Buffer) WrapBytes(data []byte) *goja.Object

type StringCodec

type StringCodec interface {
	DecodeAppend(string, []byte) []byte
	Encode([]byte) string
}

func StringCodecByName

func StringCodecByName(name string) StringCodec

Jump to

Keyboard shortcuts

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