Documentation ¶
Index ¶
- Variables
- func ArrayFrom(v js.Value) js.Value
- func AwaitPromise(promiseVal js.Value) (js.Value, error)
- func ConvertReaderToReadableStream(reader io.ReadCloser) js.Value
- func ConvertStreamReaderToReader(sr js.Value) io.Reader
- func DateToTime(v js.Value) (time.Time, error)
- func MaybeDate(v js.Value) (time.Time, error)
- func MaybeString(v js.Value) string
- func NewObject() js.Value
- func NewPromise(fn js.Func) js.Value
- func NewUint8Array(size int) js.Value
- func StrRecordToMap(v js.Value) map[string]string
- func TimeToDate(t time.Time) js.Value
- func TryCatch(fn js.Func) (js.Value, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( RuntimeContext = js.Global().Get("context") Binding = js.Global().Get("context").Get("binding") ObjectClass = js.Global().Get("Object") PromiseClass = js.Global().Get("Promise") RequestClass = js.Global().Get("Request") ResponseClass = js.Global().Get("Response") HeadersClass = js.Global().Get("Headers") ArrayClass = js.Global().Get("Array") Uint8ArrayClass = js.Global().Get("Uint8Array") ErrorClass = js.Global().Get("Error") ReadableStreamClass = js.Global().Get("ReadableStream") DateClass = js.Global().Get("Date") Null = js.ValueOf(nil) )
Functions ¶
func ConvertReaderToReadableStream ¶
func ConvertReaderToReadableStream(reader io.ReadCloser) js.Value
ConvertReaderToReadableStream converts io.ReadCloser to ReadableStream.
func ConvertStreamReaderToReader ¶
ConvertStreamReaderToReader converts ReadableStreamDefaultReader to io.Reader.
func DateToTime ¶
DateToTime converts JavaScript side's Data object into time.Time.
func MaybeDate ¶
MaybeDate returns time.Time value of given JavaScript Date value or returns nil if the value is undefined.
func MaybeString ¶
MaybeString returns string value of given JavaScript value or returns nil if the value is undefined.
func NewUint8Array ¶
func StrRecordToMap ¶
StrRecordToMap converts JavaScript side's Record<string, string> into map[string]string.
func TimeToDate ¶
TimeToDate converts Go side's time.Time into Date object.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.