Documentation
¶
Index ¶
- func AddScript(url, objName string, timeout time.Duration)
- func Debug(a ...interface{})
- func DownloadStream(filename, contentType string, r io.Reader) error
- func JSColor(c color.Color) string
- func JSTypedArray(sliceOrArray interface{}) (js.Value, error)
- func ValueFromStruct(Struct interface{}, skipZeroValues bool) js.Value
- type JSValuer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddScript ¶
AddScript is a helper function for adding a script to HTML document head and verifying it was added correctly given the object name. If no object name is passed the script will not wait
func Debug ¶ added in v0.0.2
func Debug(a ...interface{})
Debug prints JSON representation of underlying js.Value if found. Not for use with common Go types.
func DownloadStream ¶
DownloadStream downloads an io.Reader's contents as a file with the contentType (i.e. "text/csv", "application/json")
func JSTypedArray ¶
JSTypedArray returns a javascript TypedArray for the corresponding Go type. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
func ValueFromStruct ¶
ValueFromStruct converts a struct with `js` field tags to a javascript Object type with the non-nil fields set to the struct's values. if skipZeroValues is true then fields with a Go zero-value are not set in the javascript resulting object.