Documentation ¶
Index ¶
- func GenerateSearchQuery(depth int) string
- type Article
- type Config
- type DB
- type DGraph
- func (dg *DGraph) AddVisited(article *Article) error
- func (dg *DGraph) NextsToVisit(count int) ([]string, error)
- func (dg *DGraph) SearchArticleByTitle(s string, depth int) ([]Article, error)
- func (dg *DGraph) SearchArticleByUid(uid string, depth int) ([]Article, error)
- func (dg *DGraph) ShortestPath(from string, to string) ([]Article, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateSearchQuery ¶
Types ¶
type Article ¶
type Article struct { UID string `json:"uid,omitempty"` Title string `json:"title,omitempty"` Description string `json:"description,omitempty"` Missing bool `json:"missing,omitempty"` LinkedArticles []Article `json:"linked_articles,omitempty"` LastCrawled string `json:"last_crawled,omitempty"` DType []string `json:"D_type,omitempty"` PageID int `json:"page_id,omitempty"` }
Article contains information about a MediaWiki article
type DB ¶
type DB interface { // AddVisited writes the visited article and its edges with other articles. // It should be called after each article has been visited. AddVisited(*Article) error // NextsToVisit returns a list of Titles at random from the list of articles that have yet // to be visited. If there is nothing to visit, this function blocks // indefinitely until there is one. NextsToVisit(count int) ([]string, error) }
DB is the interface to interact with a database
type DGraph ¶
type DGraph struct {
// contains filtered or unexported fields
}
DGraph is a connection to a dgraph instance
func (*DGraph) AddVisited ¶
func (*DGraph) SearchArticleByTitle ¶
func (*DGraph) SearchArticleByUid ¶
Click to show internal directories.
Click to hide internal directories.