wikipedia

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Page added in v1.0.1

type Page struct {
	XMLName    xml.Name   `xml:"page"`
	Title      string     `xml:"title"`
	NS         int        `xml:"ns"`
	ID         int        `xml:"id"`
	Redirect   []Redirect `xml:"redirect"`
	RevisionID string     `xml:"revision>id"`
	Timestamp  string     `xml:"revision>timestamp"`
	Username   string     `xml:"revision>contributor>username"`
	UserID     string     `xml:"revision>contributor>id"`
	Model      string     `xml:"revision>model"`
	Format     string     `xml:"revision>format"`
	Text       string     `xml:"revision>text"`
}

type Redirect added in v1.0.1

type Redirect struct {
	Title string `xml:"title,attr"`
}

type Wiki

type Wiki struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func CreateWiki

func CreateWiki(root_path string, indexFile string, articlesFile string) *Wiki

func (*Wiki) GetArticle

func (mu *Wiki) GetArticle(name string) (Page, error)

func (*Wiki) LoadIndex

func (mu *Wiki) LoadIndex(limit int) error

TODO read redirect from content and modify index to it

func (*Wiki) SearchTitles

func (mu *Wiki) SearchTitles(key string) ([]string, error)

Jump to

Keyboard shortcuts

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