Documentation ¶
Index ¶
- func GetSupportedBackends() []string
- func GetSupportedWikis() []string
- func GetWikiInfoFromHost(host string) (*wikiInfo, error)
- func GetWikiInfoFromName(name string) (*wikiInfo, error)
- func GetWikiInfoStrings(backendFilter string) []string
- func TrimLower(s string) string
- type Manifest
- type QueryData
- type WikiNotSupportedError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSupportedBackends ¶
func GetSupportedBackends() []string
GetSupportedBackends returns a list of the names of all wiki backends supported by wikiscrape.
func GetSupportedWikis ¶
func GetSupportedWikis() []string
GetSupportedWikis returns a list of the names of all wikis supported by wikiscrape
func GetWikiInfoFromHost ¶
GetWikiInfoFromHost takes a URL host segment and returns its corresponding wikiInfo. Fails if the wiki is not supported by wikiscrape.
func GetWikiInfoFromName ¶
GetWikiInfoFromName takes a wiki name and returns its corresponding wikiInfo. Fails if the wiki is not supported by wikiscrape.
func GetWikiInfoStrings ¶
GetWikiInfoStrings returns a formatted slice of strings containing relevant information about the wikis supported by wikiscrape. This function is designed for use with the List command.
Types ¶
type Manifest ¶
type Manifest []string
func ReadManifestFrom ¶
ReadManifestFrom accepts a path to a JSON file containing an array of page names and reads its content.
type QueryData ¶
type QueryData struct { Info *wikiInfo Page string }
QueryData represents all the information the internal/wiki and internal/scraper packages need to make queries to their respective APIs.
func GetQueryDataFromName ¶
GetQueryDataFromName accepts a page name and wikiname, checks for explicit support (existing wikiInfo entry in the wikiNameInfo map) and returns a QueryData object which provides all the necessary information to make a query to the wiki's api.
func GetQueryDataFromURL ¶
GetQueryDataFromURL accepts a raw wiki url, parses it's host name, checks for explicit support (existing wikiInfo entry in the wikiHostInfo map) and returns a QueryData object which provides all the necessary information to make a query to the wiki's api.
type WikiNotSupportedError ¶
Custom error designed indicate to the user that the wiki they are trying to escape is not explicitly supported by the program.
func (*WikiNotSupportedError) Error ¶
func (e *WikiNotSupportedError) Error() string
Error returns a formatted WikiNotSupportedError including code and additional information.