Documentation ¶
Index ¶
- Variables
- func CacheUrl(url string) (*goquery.Document, error)
- func Goquery(url string, goquerySelector string) (domNode *goquery.Selection)
- func GoqueryDocument(url string) *goquery.Document
- func GoqueryFromDocument(doc *goquery.Document, goquerySelector string) (domNode *goquery.Selection)
- func GoqueryFromNode(node *goquery.Selection, goquerySelector string) (domNode *goquery.Selection)
- type Action
- type DOMSelection
- type GoqueryResults
- func Debug(resultsList []GoqueryResults, idx int) ([]GoqueryResults, error)
- func GoqueryAttrsFromParents(url string, selectors []string, attr string) (results GoqueryResults, err error)
- func GoqueryHrefsFrom(url string, goquerySelector string) (results GoqueryResults, err error)
- func GoqueryHrefsFromParents(url string, selectors []string) (results GoqueryResults, err error)
- func GoqueryTextFrom(url string, goquerySelector string) (results GoqueryResults, err error)
- func GoqueryTextFromParents(url string, selectors []string) (results GoqueryResults, err error)
- func Skip(resultsList []GoqueryResults, idx int) ([]GoqueryResults, error)
- type Query
- type QueryDSL
- type QueryFlow
- type URI
- type URIFlow
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ReloadCache bool CacheDir = "/tmp/.tune.cli" UserAgent = "Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:53.0) Gecko/20100101 Firefox/53.0" )
View Source
var (
CacheGoquery bool
)
View Source
var ( LocalActionMap = map[string]Action{ "~": Skip, "debug": Debug, } )
local actionmap
Functions ¶
func GoqueryDocument ¶
func GoqueryFromDocument ¶
Types ¶
type Action ¶
type Action func([]GoqueryResults, int) ([]GoqueryResults, error)
Action type is for the actual functions that will process query's results and return same or processed result. It gets passed list of GoqueryResults for a queryflow, and index of current query. Index is passed as '-1' if Action is used at parent (QueryFlow) layer post processing all queries.
type DOMSelection ¶
type GoqueryResults ¶
type GoqueryResults struct {
Results []string
}
func Debug ¶
func Debug(resultsList []GoqueryResults, idx int) ([]GoqueryResults, error)
Debug is a sample built-in action. That can be passed as action for query/queries to print results during development phase.
func GoqueryAttrsFromParents ¶
func GoqueryAttrsFromParents(url string, selectors []string, attr string) (results GoqueryResults, err error)
func GoqueryHrefsFrom ¶
func GoqueryHrefsFrom(url string, goquerySelector string) (results GoqueryResults, err error)
func GoqueryHrefsFromParents ¶
func GoqueryHrefsFromParents(url string, selectors []string) (results GoqueryResults, err error)
func GoqueryTextFrom ¶
func GoqueryTextFrom(url string, goquerySelector string) (results GoqueryResults, err error)
func GoqueryTextFromParents ¶
func GoqueryTextFromParents(url string, selectors []string) (results GoqueryResults, err error)
func Skip ¶
func Skip(resultsList []GoqueryResults, idx int) ([]GoqueryResults, error)
Skip is a built-in action for cases when no action on query results is desried to be handled by golgoquery.
func (*GoqueryResults) GoqueryAttrsFrom ¶
func (results *GoqueryResults) GoqueryAttrsFrom(domNodes *goquery.Selection, attr string) (err error)
type QueryDSL ¶
type QueryDSL struct {
URIFlows [](*URIFlow) `json:"uriflows"`
}
func FromFile ¶
FromFile can be passed file with JSON blob representing QueryDSL and map of action name to function, to process the DSL.
type QueryFlow ¶
type QueryFlow struct { ResultsList []GoqueryResults `json:"content"` Queries [](*Query) `json:"queries"` ActionName string `json:"action"` }
Click to show internal directories.
Click to hide internal directories.