Documentation ¶
Index ¶
- Constants
- Variables
- func GetIn(from core.Value, byPath []core.Value) (core.Value, error)
- func IsHTMLScreenshotFormatValid(format string) bool
- func MapHash(input map[string]core.Value) uint64
- func Parse(input interface{}) core.Value
- func SetIn(to core.Value, byPath []core.Value, value core.Value) error
- func ToArray(input core.Value) core.Value
- func ToBoolean(input core.Value) core.Value
- func Unmarshal(value json.RawMessage) (core.Value, error)
- type Array
- func (t *Array) Clone() core.Cloneable
- func (t *Array) Compare(other core.Value) int
- func (t *Array) Copy() core.Value
- func (t *Array) ForEach(predicate ArrayPredicate)
- func (t *Array) Get(idx Int) core.Value
- func (t *Array) Hash() uint64
- func (t *Array) IndexOf(item core.Value) Int
- func (t *Array) Insert(idx Int, value core.Value)
- func (t *Array) Length() Int
- func (t *Array) MarshalJSON() ([]byte, error)
- func (t *Array) Push(item core.Value)
- func (t *Array) RemoveAt(idx Int)
- func (t *Array) Set(idx Int, value core.Value) error
- func (t *Array) Slice(from, to Int) *Array
- func (t *Array) Sort() *Array
- func (t *Array) SortWith(sorter ArraySorter) *Array
- func (t *Array) String() string
- func (t *Array) Type() core.Type
- func (t *Array) Unwrap() interface{}
- type ArrayPredicate
- type ArraySorter
- type Binary
- type Boolean
- type DHTMLDocument
- type DHTMLNode
- type DateTime
- type Float
- type HTMLDocument
- type HTMLNode
- type HTMLPDFParams
- type HTMLScreenshotFormat
- type HTMLScreenshotParams
- type Int
- type Object
- func (t *Object) Clone() core.Cloneable
- func (t *Object) Compare(other core.Value) int
- func (t *Object) Copy() core.Value
- func (t *Object) ForEach(predicate ObjectPredicate)
- func (t *Object) Get(key String) (core.Value, Boolean)
- func (t *Object) GetIn(path []core.Value) (core.Value, error)
- func (t *Object) Hash() uint64
- func (t *Object) Keys() []string
- func (t *Object) Length() Int
- func (t *Object) MarshalJSON() ([]byte, error)
- func (t *Object) Remove(key String)
- func (t *Object) Set(key String, value core.Value)
- func (t *Object) SetIn(path []core.Value, value core.Value) error
- func (t *Object) String() string
- func (t *Object) Type() core.Type
- func (t *Object) Unwrap() interface{}
- type ObjectPredicate
- type ObjectProperty
- type String
- func (t String) Compare(other core.Value) int
- func (t String) Concat(other core.Value) String
- func (t String) Contains(other String) Boolean
- func (t String) Copy() core.Value
- func (t String) Hash() uint64
- func (t String) IndexOf(other String) Int
- func (t String) Length() Int
- func (t String) MarshalJSON() ([]byte, error)
- func (t String) String() string
- func (t String) Type() core.Type
- func (t String) Unwrap() interface{}
Constants ¶
View Source
const DefaultTimeLayout = time.RFC3339
Variables ¶
View Source
var EmptyString = String("")
View Source
var False = Boolean(false)
View Source
var None = &none{}
View Source
var SpaceString = String(" ")
View Source
var True = Boolean(true)
View Source
var ZeroDateTime = DateTime{ time.Time{}, }
View Source
var ZeroFloat = Float(0.0)
View Source
var ZeroInt = Int(0)
Functions ¶
func IsHTMLScreenshotFormatValid ¶ added in v0.6.0
Types ¶
type Array ¶
type Array struct {
// contains filtered or unexported fields
}
func NewArrayWith ¶
func (*Array) ForEach ¶
func (t *Array) ForEach(predicate ArrayPredicate)
func (*Array) MarshalJSON ¶
func (*Array) SortWith ¶ added in v0.5.0
func (t *Array) SortWith(sorter ArraySorter) *Array
type ArraySorter ¶ added in v0.5.0
type Boolean ¶
type Boolean bool
func IsCloneable ¶
func NewBoolean ¶
func ParseBoolean ¶
func ParseBooleanP ¶
func ParseBooleanP(input interface{}) Boolean
func (Boolean) MarshalJSON ¶
type DHTMLDocument ¶ added in v0.6.0
type DHTMLDocument interface { HTMLDocument io.Closer ClickBySelector(selector String) (Boolean, error) ClickBySelectorAll(selector String) (Boolean, error) InputBySelector(selector String, value core.Value, delay Int) (Boolean, error) SelectBySelector(selector String, value *Array) (*Array, error) HoverBySelector(selector String) error PrintToPDF(params HTMLPDFParams) (Binary, error) CaptureScreenshot(params HTMLScreenshotParams) (Binary, error) ScrollTop() error ScrollBottom() error ScrollBySelector(selector String) error WaitForSelector(selector String, timeout Int) error WaitForClass(selector, class String, timeout Int) error WaitForClassAll(selector, class String, timeout Int) error }
DHTMLDocument is a Dynamic HTML Document
type DateTime ¶
func NewCurrentDateTime ¶
func NewCurrentDateTime() DateTime
func NewDateTime ¶
func ParseDateTime ¶
func ParseDateTimeP ¶
func ParseDateTimeP(input interface{}) DateTime
func ParseDateTimeWith ¶
func (DateTime) MarshalJSON ¶
type Float ¶
type Float float64
func ParseFloat ¶
func ParseFloatP ¶
func ParseFloatP(input interface{}) Float
func (Float) MarshalJSON ¶
type HTMLDocument ¶
HTMLDocument is a HTML Document
type HTMLNode ¶
type HTMLNode interface { core.Value NodeType() Int NodeName() String Length() Int InnerText() String InnerHTML() String Value() core.Value GetAttributes() core.Value GetAttribute(name String) core.Value GetChildNodes() core.Value GetChildNode(idx Int) core.Value QuerySelector(selector String) core.Value QuerySelectorAll(selector String) core.Value InnerHTMLBySelector(selector String) String InnerHTMLBySelectorAll(selector String) *Array InnerTextBySelector(selector String) String InnerTextBySelectorAll(selector String) *Array CountBySelector(selector String) Int ExistsBySelector(selector String) Boolean }
HTMLNode is a HTML Node
type HTMLPDFParams ¶ added in v0.6.0
type HTMLPDFParams struct { // Paper orientation. Defaults to false. Landscape Boolean DisplayHeaderFooter Boolean // Print background graphics. Defaults to false. PrintBackground Boolean // Scale of the webpage rendering. Defaults to 1. Scale Float // Paper width in inches. Defaults to 8.5 inches. PaperWidth Float // Paper height in inches. Defaults to 11 inches. PaperHeight Float // Top margin in inches. Defaults to 1cm (~0.4 inches). MarginTop Float // Bottom margin in inches. Defaults to 1cm (~0.4 inches). MarginBottom Float // Left margin in inches. Defaults to 1cm (~0.4 inches). MarginLeft Float // Right margin in inches. Defaults to 1cm (~0.4 inches). MarginRight Float // Paper ranges to print, e.g., '1-5, 8, 11-13'. Defaults to the empty string, which means print all pages. PageRanges String // Whether to silently ignore invalid but successfully parsed page ranges, such as '3-2'. Defaults to false. IgnoreInvalidPageRanges Boolean // HTML template for the print header. Should be valid HTML markup with following classes used to inject printing values into them: - `date`: formatted print date - `title`: document title - `url`: document location - `pageNumber`: current page number - `totalPages`: total pages in the document // For example, `<span class=title></span>` would generate span containing the title. HeaderTemplate String FooterTemplate String // Whether or not to prefer page size as defined by css. // Defaults to false, in which case the content will be scaled to fit the paper size. PreferCSSPageSize Boolean }
HTMLPDFParams represents the arguments for PrintToPDF function.
func NewDefaultHTMLPDFParams ¶ added in v0.6.0
func NewDefaultHTMLPDFParams() HTMLPDFParams
type HTMLScreenshotFormat ¶ added in v0.6.0
type HTMLScreenshotFormat string
const ( HTMLScreenshotFormatPNG HTMLScreenshotFormat = "png" HTMLScreenshotFormatJPEG HTMLScreenshotFormat = "jpeg" )
type HTMLScreenshotParams ¶ added in v0.6.0
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func NewObjectWith ¶
func NewObjectWith(props ...*ObjectProperty) *Object
func (*Object) Compare ¶
Compare compares the source object with other core.Value The behavior of the Compare is similar to the comparison of objects in ArangoDB
func (*Object) ForEach ¶
func (t *Object) ForEach(predicate ObjectPredicate)
func (*Object) MarshalJSON ¶
type ObjectProperty ¶
type ObjectProperty struct {
// contains filtered or unexported fields
}
func NewObjectProperty ¶
func NewObjectProperty(name string, value core.Value) *ObjectProperty
type String ¶
type String string
func NewStringFromRunes ¶
func ParseString ¶
func ParseStringP ¶
func ParseStringP(input interface{}) String
func (String) MarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.