engine

package
v0.0.0-...-9fd5d19 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine interface {
	// NewSearchObject makes a new Search struct.
	NewSearchObject(searchText string) (SearchObject, error)
}

Engine is a nice abstraction for the scraping engine. Not sure if this needs to be implemented yet.

type LatexObject

type LatexObject struct {
	Label string `json:"label"` // What the object represents
	URL   string `json:"url"`   // The url to the object
}

LatexObject represents a LaTeX object.

func NewLatexObject

func NewLatexObject(label, url string) (LatexObject, error)

NewLatexObject creates a new LatexObject.

func (LatexObject) String

func (latexObject LatexObject) String() string

String marshals a latexObject as a string.

type Result

type Result []LatexObject

Result is the type for a search result

func (Result) String

func (result Result) String() string

type SearchObject

type SearchObject struct {
	SearchText string    `json:"search_text"` // The search text
	Request    string    `json:"request"`     // The WolframAlpha request (URL)
	Time       time.Time `json:"time"`        // The time of search
	Result     Result    `json:"result"`      // The search result
}

SearchObject represents a search on WolframAlpha.

func NewSearchObject

func NewSearchObject(searchText string) (SearchObject, error)

NewSearchObject makes a new Search struct.

func (*SearchObject) Search

func (search *SearchObject) Search(cwd *core.ChromeWebDriver) error

Search will execute the search.

Jump to

Keyboard shortcuts

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