file

package
v0.0.0-...-41cedfc Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: BSD-3-Clause Imports: 5 Imported by: 12

Documentation

Overview

Package fileapi provides an API for representing file objects in web applications, as well as programmatically selecting them and accessing their data.

Source: File API (https://w3c.github.io/FileAPI/)

Index

Constants

View Source
const (
	EMPTY   int = 0
	LOADING int = 1
	DONE    int = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Blob

type Blob struct {
	// Value_JS holds a reference to a javascript value
	Value_JS js.Value
}

class: Blob

func BlobFromJS

func BlobFromJS(value js.Value) *Blob

BlobFromJS is casting a js.Value into Blob.

func BlobFromWrapper

func BlobFromWrapper(input core.Wrapper) *Blob

BlobFromJS is casting from something that holds a js.Value into Blob.

func NewBlob

func NewBlob(blobParts []*Union, options *BlobPropertyBag) (_result *Blob)

func (*Blob) JSValue

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

JSValue returns the js.Value or js.Null() if _this is nil

func (*Blob) Size

func (_this *Blob) Size() int

Size returning attribute 'size' with type int (idl: unsigned long long).

func (*Blob) Slice

func (_this *Blob) Slice(start *int, end *int, contentType *string) (_result *Blob)

func (*Blob) Type

func (_this *Blob) Type() string

Type returning attribute 'type' with type string (idl: DOMString).

type BlobCallback

type BlobCallback js.Func

BlobCallback is a javascript function type.

Call Release() when done to release resouces allocated to this type.

func BlobCallbackToJS

func BlobCallbackToJS(callback BlobCallbackFunc) *BlobCallback

type BlobCallbackFunc

type BlobCallbackFunc func(blob *Blob)

callback: BlobCallback

func BlobCallbackFromJS

func BlobCallbackFromJS(_value js.Value) BlobCallbackFunc

type BlobPropertyBag

type BlobPropertyBag struct {
	Type    string
	Endings EndingType
}

dictionary: BlobPropertyBag

func BlobPropertyBagFromJS

func BlobPropertyBagFromJS(value js.Value) *BlobPropertyBag

BlobPropertyBagFromJS is allocating a new BlobPropertyBag object and copy all values in the value javascript object.

func (*BlobPropertyBag) JSValue

func (_this *BlobPropertyBag) JSValue() js.Value

JSValue is allocating a new javascript object and copy all values

type EndingType

type EndingType int

enum: EndingType

const (
	TransparentEndingType EndingType = iota
	NativeEndingType
)

func EndingTypeFromJS

func EndingTypeFromJS(value js.Value) EndingType

EndingTypeFromJS is converting a javascript value into a EndingType enum value.

func (*EndingType) JSValue

func (this *EndingType) JSValue() js.Value

JSValue is converting this enum into a javascript object

func (EndingType) Value

func (this EndingType) Value() string

Value is converting this into javascript defined string value

type File

type File struct {
	Blob
}

class: File

func FileFromJS

func FileFromJS(value js.Value) *File

FileFromJS is casting a js.Value into File.

func FileFromWrapper

func FileFromWrapper(input core.Wrapper) *File

FileFromJS is casting from something that holds a js.Value into File.

func NewFile

func NewFile(fileBits []*Union, fileName string, options *FilePropertyBag) (_result *File)

func (*File) LastModified

func (_this *File) LastModified() int

LastModified returning attribute 'lastModified' with type int (idl: long long).

func (*File) Name

func (_this *File) Name() string

Name returning attribute 'name' with type string (idl: DOMString).

func (*File) WebkitRelativePath

func (_this *File) WebkitRelativePath() string

WebkitRelativePath returning attribute 'webkitRelativePath' with type string (idl: USVString).

type FileList

type FileList struct {
	// Value_JS holds a reference to a javascript value
	Value_JS js.Value
}

class: FileList

func FileListFromJS

func FileListFromJS(value js.Value) *FileList

FileListFromJS is casting a js.Value into FileList.

func FileListFromWrapper

func FileListFromWrapper(input core.Wrapper) *FileList

FileListFromJS is casting from something that holds a js.Value into FileList.

func (*FileList) Index

func (_this *FileList) Index(index uint) (_result *File)

func (*FileList) Item

func (_this *FileList) Item(index uint) (_result *File)

func (*FileList) JSValue

func (_this *FileList) JSValue() js.Value

JSValue returns the js.Value or js.Null() if _this is nil

func (*FileList) Length

func (_this *FileList) Length() uint

Length returning attribute 'length' with type uint (idl: unsigned long).

type FilePropertyBag

type FilePropertyBag struct {
	Type         string
	Endings      EndingType
	LastModified int
}

dictionary: FilePropertyBag

func FilePropertyBagFromJS

func FilePropertyBagFromJS(value js.Value) *FilePropertyBag

FilePropertyBagFromJS is allocating a new FilePropertyBag object and copy all values in the value javascript object.

func (*FilePropertyBag) JSValue

func (_this *FilePropertyBag) JSValue() js.Value

JSValue is allocating a new javascript object and copy all values

type FileReader

type FileReader struct {
	domcore.EventTarget
}

class: FileReader

func FileReaderFromJS

func FileReaderFromJS(value js.Value) *FileReader

FileReaderFromJS is casting a js.Value into FileReader.

func FileReaderFromWrapper

func FileReaderFromWrapper(input core.Wrapper) *FileReader

FileReaderFromJS is casting from something that holds a js.Value into FileReader.

func NewFileReader

func NewFileReader() (_result *FileReader)

func (*FileReader) Abort

func (_this *FileReader) Abort()

func (*FileReader) AddEventAbort

func (_this *FileReader) AddEventAbort(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

AddAbort is adding doing AddEventListener for 'Abort' on target. This method is returning allocated javascript function that need to be released.

func (*FileReader) AddEventError

func (_this *FileReader) AddEventError(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

AddError is adding doing AddEventListener for 'Error' on target. This method is returning allocated javascript function that need to be released.

func (*FileReader) AddEventLoad

func (_this *FileReader) AddEventLoad(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

AddLoad is adding doing AddEventListener for 'Load' on target. This method is returning allocated javascript function that need to be released.

func (*FileReader) AddEventLoadEnd

func (_this *FileReader) AddEventLoadEnd(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

AddLoadEnd is adding doing AddEventListener for 'LoadEnd' on target. This method is returning allocated javascript function that need to be released.

func (*FileReader) AddEventLoadStart

func (_this *FileReader) AddEventLoadStart(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

AddLoadStart is adding doing AddEventListener for 'LoadStart' on target. This method is returning allocated javascript function that need to be released.

func (*FileReader) AddEventProgress

func (_this *FileReader) AddEventProgress(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

AddProgress is adding doing AddEventListener for 'Progress' on target. This method is returning allocated javascript function that need to be released.

func (*FileReader) Error

func (_this *FileReader) Error() *domcore.DOMException

Error returning attribute 'error' with type domcore.DOMException (idl: DOMException).

func (*FileReader) OnAbort

func (_this *FileReader) OnAbort() domcore.EventHandlerFunc

OnAbort returning attribute 'onabort' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*FileReader) OnError

func (_this *FileReader) OnError() domcore.EventHandlerFunc

OnError returning attribute 'onerror' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*FileReader) OnLoad

func (_this *FileReader) OnLoad() domcore.EventHandlerFunc

OnLoad returning attribute 'onload' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*FileReader) OnLoadEnd

func (_this *FileReader) OnLoadEnd() domcore.EventHandlerFunc

OnLoadEnd returning attribute 'onloadend' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*FileReader) OnLoadStart

func (_this *FileReader) OnLoadStart() domcore.EventHandlerFunc

OnLoadStart returning attribute 'onloadstart' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*FileReader) OnProgress

func (_this *FileReader) OnProgress() domcore.EventHandlerFunc

OnProgress returning attribute 'onprogress' with type domcore.EventHandler (idl: EventHandlerNonNull).

func (*FileReader) ReadAsArrayBuffer

func (_this *FileReader) ReadAsArrayBuffer(blob *Blob)

func (*FileReader) ReadAsBinaryString

func (_this *FileReader) ReadAsBinaryString(blob *Blob)

func (*FileReader) ReadAsDataURL

func (_this *FileReader) ReadAsDataURL(blob *Blob)

func (*FileReader) ReadAsText

func (_this *FileReader) ReadAsText(blob *Blob, encoding *string)

func (*FileReader) ReadyState

func (_this *FileReader) ReadyState() int

ReadyState returning attribute 'readyState' with type int (idl: unsigned short).

func (*FileReader) Result

func (_this *FileReader) Result() *Union

Result returning attribute 'result' with type Union (idl: Union).

func (*FileReader) SetOnAbort

func (_this *FileReader) SetOnAbort(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

SetOnAbort is assigning a function to 'onabort'. This This method is returning allocated javascript function that need to be released.

func (*FileReader) SetOnError

func (_this *FileReader) SetOnError(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

SetOnError is assigning a function to 'onerror'. This This method is returning allocated javascript function that need to be released.

func (*FileReader) SetOnLoad

func (_this *FileReader) SetOnLoad(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

SetOnLoad is assigning a function to 'onload'. This This method is returning allocated javascript function that need to be released.

func (*FileReader) SetOnLoadEnd

func (_this *FileReader) SetOnLoadEnd(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

SetOnLoadEnd is assigning a function to 'onloadend'. This This method is returning allocated javascript function that need to be released.

func (*FileReader) SetOnLoadStart

func (_this *FileReader) SetOnLoadStart(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

SetOnLoadStart is assigning a function to 'onloadstart'. This This method is returning allocated javascript function that need to be released.

func (*FileReader) SetOnProgress

func (_this *FileReader) SetOnProgress(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func

SetOnProgress is assigning a function to 'onprogress'. This This method is returning allocated javascript function that need to be released.

type FileReaderSync

type FileReaderSync struct {
	// Value_JS holds a reference to a javascript value
	Value_JS js.Value
}

class: FileReaderSync

func FileReaderSyncFromJS

func FileReaderSyncFromJS(value js.Value) *FileReaderSync

FileReaderSyncFromJS is casting a js.Value into FileReaderSync.

func FileReaderSyncFromWrapper

func FileReaderSyncFromWrapper(input core.Wrapper) *FileReaderSync

FileReaderSyncFromJS is casting from something that holds a js.Value into FileReaderSync.

func NewFileReaderSync

func NewFileReaderSync() (_result *FileReaderSync)

func (*FileReaderSync) JSValue

func (_this *FileReaderSync) JSValue() js.Value

JSValue returns the js.Value or js.Null() if _this is nil

func (*FileReaderSync) ReadAsArrayBuffer

func (_this *FileReaderSync) ReadAsArrayBuffer(blob *Blob) (_result *javascript.ArrayBuffer)

func (*FileReaderSync) ReadAsBinaryString

func (_this *FileReaderSync) ReadAsBinaryString(blob *Blob) (_result string)

func (*FileReaderSync) ReadAsDataURL

func (_this *FileReaderSync) ReadAsDataURL(blob *Blob) (_result string)

func (*FileReaderSync) ReadAsText

func (_this *FileReaderSync) ReadAsText(blob *Blob, encoding *string) (_result string)

type PromiseBlob

type PromiseBlob struct {
	// Value_JS holds a reference to a javascript value
	Value_JS js.Value
}

class: Promise

func PromiseBlobFromJS

func PromiseBlobFromJS(value js.Value) *PromiseBlob

PromiseBlobFromJS is casting a js.Value into PromiseBlob.

func PromiseBlobFromWrapper

func PromiseBlobFromWrapper(input core.Wrapper) *PromiseBlob

PromiseBlobFromJS is casting from something that holds a js.Value into PromiseBlob.

func (*PromiseBlob) Catch

func (_this *PromiseBlob) Catch(onRejected *PromiseBlobOnRejected) (_result *PromiseBlob)

func (*PromiseBlob) Finally

func (_this *PromiseBlob) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseBlob)

func (*PromiseBlob) JSValue

func (_this *PromiseBlob) JSValue() js.Value

JSValue returns the js.Value or js.Null() if _this is nil

func (*PromiseBlob) Then

func (_this *PromiseBlob) Then(onFulfilled *PromiseBlobOnFulfilled, onRejected *PromiseBlobOnRejected) (_result *PromiseBlob)

type PromiseBlobOnFulfilled

type PromiseBlobOnFulfilled js.Func

PromiseBlobOnFulfilled is a javascript function type.

Call Release() when done to release resouces allocated to this type.

func PromiseBlobOnFulfilledToJS

func PromiseBlobOnFulfilledToJS(callback PromiseBlobOnFulfilledFunc) *PromiseBlobOnFulfilled

type PromiseBlobOnFulfilledFunc

type PromiseBlobOnFulfilledFunc func(value *Blob)

callback: PromiseTemplateOnFulfilled

func PromiseBlobOnFulfilledFromJS

func PromiseBlobOnFulfilledFromJS(_value js.Value) PromiseBlobOnFulfilledFunc

type PromiseBlobOnRejected

type PromiseBlobOnRejected js.Func

PromiseBlobOnRejected is a javascript function type.

Call Release() when done to release resouces allocated to this type.

func PromiseBlobOnRejectedToJS

func PromiseBlobOnRejectedToJS(callback PromiseBlobOnRejectedFunc) *PromiseBlobOnRejected

type PromiseBlobOnRejectedFunc

type PromiseBlobOnRejectedFunc func(reason js.Value)

callback: PromiseTemplateOnRejected

func PromiseBlobOnRejectedFromJS

func PromiseBlobOnRejectedFromJS(_value js.Value) PromiseBlobOnRejectedFunc

type Union

type Union struct {
	Value js.Value
}

func UnionFromJS

func UnionFromJS(value js.Value) *Union

func (*Union) JSValue

func (u *Union) JSValue() js.Value

Directories

Path Synopsis
Package entries is file and directory upload by drag-and-drop operations.
Package entries is file and directory upload by drag-and-drop operations.

Jump to

Keyboard shortcuts

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