irasutoya

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	URL string `json:"url"`

	Title       string    `json:"title"`
	Description string    `json:"description"`
	IsSpecial   bool      `json:"is_special"` // ex: PR page
	PublishDate time.Time `json:"publish_date"`

	Categories []string  `json:"categories"`
	Irasutoes  []Irasuto `json:"irasutoes"`
}

Entry is a page from irasutoya.com. If Entry.IsSpecial is false, Entry has one or more Irasutoes.

func NewEntry

func NewEntry(url string) (Entry, error)

NewEntry is a constructor for Entry.

func (*Entry) Load

func (entry *Entry) Load() error

Load fetches and updates all irastoes included in the entry's page. This is shorthand of FetchIrastoes and setting them to Entry's attribute Irastoes.

type Irasuto

type Irasuto struct {
	Title    string `json:"title"`
	ImageURL string `json:"image_url"`
}

Irasuto describes a Illustration of Irasutoya. Irasuto has only and always one Illustration.

type SearchResult

type SearchResult struct {
	EntryURL     string `json:"entry_url"`
	ThumbnailURL string `json:"thumbnail_url"`
	Description  string `json:"description"`
}

SearchResult is result of search. Search returns multiple SearchResult. Result will corresponds Entry one-to-one.

func Search(query string) ([]SearchResult, error)

Search searches irasuto from irasutoya with given query, and returns []SearchResult.

func (*SearchResult) FetchEntry

func (sr *SearchResult) FetchEntry() (Entry, error)

FetchEntry fetches an Entry corresponds to SearchResult.

Jump to

Keyboard shortcuts

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