web

package
v0.0.0-...-a3971e5 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CacheLoop

func CacheLoop(db core.DB)

func Mux

func Mux(baseURL string, db core.DB, sp core.Spider, static string) *httprouter.Router

func StoreSpider

func StoreSpider(db core.DB, spider core.Spider, page string) (*core.Page, error)

StoreSpider tries to load a spider from the db

func UpdateCache

func UpdateCache(db core.DB)

func WikiSpider

func WikiSpider() core.Spider

func WikiURL

func WikiURL(page string) string

Types

type Author

type Author struct {
	Name string `xml:"name"`
}

type Entry

type Entry struct {
	ID      string    `xml:"id"`
	Title   string    `xml:"title"`
	Updated time.Time `xml:"updated"`
	Content string    `xml:"content"`
	Links   []Link    `xml:"link"`
}

type Feed

type Feed struct {
	XMLName xml.Name  `xml:"feed"`
	XMLNS   string    `xml:"xmlns,attr"`
	ID      string    `xml:"id"`
	Title   string    `xml:"title"`
	Links   []Link    `xml:"link"`
	Updated time.Time `xml:"updated"`
	Author  Author    `xml:"author"`
	Entries []Entry   `xml:"entry"`
}
type Link struct {
	Href string `xml:"href,attr"`
	Rel  string `xml:"rel,attr,omitempty"`
	Type string `xml:"type,attr,omitempty"`
}

type PageJSON

type PageJSON struct {
	Page          string `json:"page"`
	Title         string `json:"title"`
	StableVersion string `json:"stable_version"`
	Homepage      string `json:"homepage"`
	WikipediaURL  string `json:"wikipedia_url"`
}

PageJSON is returned for ?format=json

Jump to

Keyboard shortcuts

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