Documentation ¶
Overview ¶
Package rankings contains logic for parsing rankings data -- either from stored JSON files or from a database -- and combining them into a SERP containing prominent results for a search as well as the keyword that yielded those results.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuildError ¶
type BuildError struct {
Errors []error
}
BuildError represents one or more errors that could occur as the result processing a directory
func (BuildError) Error ¶
func (be BuildError) Error() string
type KeywordData ¶
KeywordData contains all SERP data for a group of keywords
func ProcessDirectory ¶
func ProcessDirectory(directory string) (KeywordData, error)
ProcessDirectory scans a directory for files containing SERP data and builds a KeywordData from their contents
func (KeywordData) BuildFromDatabase ¶
func (kd KeywordData) BuildFromDatabase(driver *data.Driver, domainID int, keywords []string, bar *pb.ProgressBar) error
BuildFromDatabase fetches prominent SERP members from the database for each given keyword
func (KeywordData) BuildFromDisk ¶
func (kd KeywordData) BuildFromDisk(paths []string) error
BuildFromDisk builds a KeywordData set by parsing and adding SERP members
type SERP ¶
type SERP struct { Keyword string Members []SERPMember }
SERP contains a set of related serps
type SERPMember ¶
type SERPMember struct { Keyword string `json:"keyword"` Prominence int `json:"prominence"` Domain string `json:"competitor"` }
SERPMember represents a ranked member in prominent entries in a SERP