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
- type Blob
- type BlobCallback
- type BlobCallbackFunc
- type BlobPropertyBag
- type EndingType
- type File
- type FileList
- type FilePropertyBag
- type FileReader
- func (_this *FileReader) Abort()
- func (_this *FileReader) AddEventAbort(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) AddEventError(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) AddEventLoad(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) AddEventLoadEnd(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) AddEventLoadStart(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) AddEventProgress(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) Error() *domcore.DOMException
- func (_this *FileReader) OnAbort() domcore.EventHandlerFunc
- func (_this *FileReader) OnError() domcore.EventHandlerFunc
- func (_this *FileReader) OnLoad() domcore.EventHandlerFunc
- func (_this *FileReader) OnLoadEnd() domcore.EventHandlerFunc
- func (_this *FileReader) OnLoadStart() domcore.EventHandlerFunc
- func (_this *FileReader) OnProgress() domcore.EventHandlerFunc
- func (_this *FileReader) ReadAsArrayBuffer(blob *Blob)
- func (_this *FileReader) ReadAsBinaryString(blob *Blob)
- func (_this *FileReader) ReadAsDataURL(blob *Blob)
- func (_this *FileReader) ReadAsText(blob *Blob, encoding *string)
- func (_this *FileReader) ReadyState() int
- func (_this *FileReader) Result() *Union
- func (_this *FileReader) SetOnAbort(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) SetOnError(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) SetOnLoad(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) SetOnLoadEnd(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) SetOnLoadStart(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- func (_this *FileReader) SetOnProgress(listener func(event *xhr.ProgressEvent, currentTarget *FileReader)) js.Func
- type FileReaderSync
- func (_this *FileReaderSync) JSValue() js.Value
- func (_this *FileReaderSync) ReadAsArrayBuffer(blob *Blob) (_result *javascript.ArrayBuffer)
- func (_this *FileReaderSync) ReadAsBinaryString(blob *Blob) (_result string)
- func (_this *FileReaderSync) ReadAsDataURL(blob *Blob) (_result string)
- func (_this *FileReaderSync) ReadAsText(blob *Blob, encoding *string) (_result string)
- type PromiseBlob
- func (_this *PromiseBlob) Catch(onRejected *PromiseBlobOnRejected) (_result *PromiseBlob)
- func (_this *PromiseBlob) Finally(onFinally *javascript.PromiseFinally) (_result *PromiseBlob)
- func (_this *PromiseBlob) JSValue() js.Value
- func (_this *PromiseBlob) Then(onFulfilled *PromiseBlobOnFulfilled, onRejected *PromiseBlobOnRejected) (_result *PromiseBlob)
- type PromiseBlobOnFulfilled
- type PromiseBlobOnFulfilledFunc
- type PromiseBlobOnRejected
- type PromiseBlobOnRejectedFunc
- type Union
Constants ¶
const ( EMPTY int = 0 LOADING int = 1 DONE int = 2 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Blob ¶
class: Blob
func BlobFromJS ¶
BlobFromJS is casting a js.Wrapper into Blob.
func NewBlob ¶
func NewBlob(blobParts []*Union, options *BlobPropertyBag) (_result *Blob)
type BlobCallback ¶
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.Wrapper) *BlobPropertyBag
BlobPropertyBagFromJS is allocating a new BlobPropertyBag object and copy all values from input javascript object
func (*BlobPropertyBag) JSValue ¶
func (_this *BlobPropertyBag) JSValue() js.Value
JSValue is allocating a new javasript 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 ¶
FileFromJS is casting a js.Wrapper into File.
func NewFile ¶
func NewFile(fileBits []*Union, fileName string, options *FilePropertyBag) (_result *File)
func (*File) LastModified ¶
LastModified returning attribute 'lastModified' with type int (idl: long long).
func (*File) WebkitRelativePath ¶
WebkitRelativePath returning attribute 'webkitRelativePath' with type string (idl: USVString).
type FileList ¶
class: FileList
func FileListFromJS ¶
FileListFromJS is casting a js.Wrapper into FileList.
type FilePropertyBag ¶
type FilePropertyBag struct { Type string Endings EndingType LastModified int }
dictionary: FilePropertyBag
func FilePropertyBagFromJS ¶
func FilePropertyBagFromJS(value js.Wrapper) *FilePropertyBag
FilePropertyBagFromJS is allocating a new FilePropertyBag object and copy all values from input javascript object
func (*FilePropertyBag) JSValue ¶
func (_this *FilePropertyBag) JSValue() js.Value
JSValue is allocating a new javasript object and copy all values
type FileReader ¶
type FileReader struct {
domcore.EventTarget
}
class: FileReader
func FileReaderFromJS ¶
func FileReaderFromJS(value js.Wrapper) *FileReader
FileReaderFromJS is casting a js.Wrapper 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.Wrapper) *FileReaderSync
FileReaderSyncFromJS is casting a js.Wrapper into FileReaderSync.
func NewFileReaderSync ¶
func NewFileReaderSync() (_result *FileReaderSync)
func (*FileReaderSync) JSValue ¶
func (_this *FileReaderSync) JSValue() js.Value
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 ¶
class: Promise
func PromiseBlobFromJS ¶
func PromiseBlobFromJS(value js.Wrapper) *PromiseBlob
PromiseBlobFromJS is casting a js.Wrapper 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
func (*PromiseBlob) Then ¶
func (_this *PromiseBlob) Then(onFulfilled *PromiseBlobOnFulfilled, onRejected *PromiseBlobOnRejected) (_result *PromiseBlob)
type PromiseBlobOnFulfilled ¶
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 ¶
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 ¶
callback: PromiseTemplateOnRejected
func PromiseBlobOnRejectedFromJS ¶
func PromiseBlobOnRejectedFromJS(_value js.Value) PromiseBlobOnRejectedFunc