eval

package
v0.0.0-...-f5aabfc Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eval

func Eval(expr ast.Expression, ctx *Context) []*html.Node

Eval function evaluate CSS selector

Types

type Context

type Context struct {
	Doc   *html.Node
	Nodes []*html.Node
	CNode []*html.Node
	CType string
}

Context contains Nodes that is used in Eval function.

func NewContext

func NewContext() *Context

NewContext creates a new context

func (*Context) GetBackCtx

func (c *Context) GetBackCtx()

GetBackCtx resets the context to the initially set context.

func (*Context) SetDoc

func (c *Context) SetDoc(input string) error

SetDoc set Doc field in a Context input param can be url or local filepath.

func (*Context) SetDocN

func (c *Context) SetDocN(n *html.Node)

SetDocN set Doc from html.Node

func (*Context) SetDocR

func (c *Context) SetDocR(r *http.Response) error

SetDocR set Doc from http.Response

func (*Context) SetDocS

func (c *Context) SetDocS(s string) error

SetDocS set Doc from string

Jump to

Keyboard shortcuts

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