Documentation ¶
Index ¶
- func GetAttribute(token html.Token, attribute string) string
- func IsUrl(str string) bool
- func NewHeadingsParser() headingsParser
- func NewHtmlVersionParser() htmlVersionParser
- func NewLinksParser() linksParser
- func NewLoginFormParser() loginFormParser
- func NewTitleParser() titleParser
- type AnalysisResponse
- type AnalysisSuccessResponse
- func (ap *AnalysisSuccessResponse) AddHeading(tag string, content string)
- func (ap *AnalysisSuccessResponse) AddLink(link Link)
- func (ap *AnalysisSuccessResponse) SetHasLogin(hasLogin bool)
- func (ap *AnalysisSuccessResponse) SetHtmlVersion(version string)
- func (ap *AnalysisSuccessResponse) SetTitle(title string)
- type Heading
- type Link
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAttribute ¶
get content of an attribute given the tag returns empty array if attribute is not found
func NewHeadingsParser ¶
func NewHeadingsParser() headingsParser
func NewHtmlVersionParser ¶
func NewHtmlVersionParser() htmlVersionParser
func NewLinksParser ¶
func NewLinksParser() linksParser
func NewLoginFormParser ¶
func NewLoginFormParser() loginFormParser
func NewTitleParser ¶
func NewTitleParser() titleParser
Types ¶
type AnalysisResponse ¶
type AnalysisResponse interface { // setting the page title. SetTitle(title string) // setting the page html version. SetHtmlVersion(version string) // setting if page has login or not. SetHasLogin(hasLogin bool) // add heading and its level AddHeading(heading string, content string) // add link AddLink(link Link) }
func NewAnalysisResponse ¶
func NewAnalysisResponse() AnalysisResponse
type AnalysisSuccessResponse ¶
type AnalysisSuccessResponse struct { Title string `json:"title"` Version string `json:"htmlVersion"` HasLogin bool `json:"hasLogin"` Headings []Heading `json:"headings"` Links []Link `json:"links"` }
func (*AnalysisSuccessResponse) AddHeading ¶
func (ap *AnalysisSuccessResponse) AddHeading(tag string, content string)
func (*AnalysisSuccessResponse) AddLink ¶
func (ap *AnalysisSuccessResponse) AddLink(link Link)
func (*AnalysisSuccessResponse) SetHasLogin ¶
func (ap *AnalysisSuccessResponse) SetHasLogin(hasLogin bool)
func (*AnalysisSuccessResponse) SetHtmlVersion ¶
func (ap *AnalysisSuccessResponse) SetHtmlVersion(version string)
func (*AnalysisSuccessResponse) SetTitle ¶
func (ap *AnalysisSuccessResponse) SetTitle(title string)
Click to show internal directories.
Click to hide internal directories.