summaries

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const ErrNoSummary = domain.Error("No summary found")

ErrNoSummary is used to communicate that no summary could be obtained from Wikipedia's API

View Source
const ErrNotWiki = domain.Error("Not a Wiki page")

ErrNotWiki is used to communicate that the URL did not correspond to a Wiki page

Variables

This section is empty.

Functions

This section is empty.

Types

type Summary

type Summary struct {
	PageID      int    `json:"pageid"`
	Type        string `json:"type"`
	Title       string `json:"title"`
	Description string `json:"description"`
	Extract     string `json:"extract"`
}

Summary stores information retrieved from querying Wikipedia's summary API

func Fetch

func Fetch(url string) (Summary, error)

Fetch queries a Wikipedia URL page for its corresponding summary API endpoint, and returns a Summary if successful, or an error if not

Jump to

Keyboard shortcuts

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