novel

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Novel

type Novel struct {
	ID          string
	Title       string
	Description string
	CoverURL    string
	Content     string
	Created     time.Time
	Uploaded    time.Time
	Author      user.User
	Series      Series
	Tags        []string

	TextCount     int64
	PageCount     int64
	CommentCount  int64
	LikeCount     int64
	ViewCount     int64
	BookmarkCount int64
}

Novel data

func (*Novel) Fetch

func (i *Novel) Fetch(ctx context.Context) (err error)

Fetch additional data from pixiv single novel api (require login),

func (Novel) URL added in v0.3.0

func (i Novel) URL(ctx context.Context) *url.URL

URL to view web page.

type SearchOption added in v0.4.0

type SearchOption func(*SearchOptions)

SearchOption mutate SearchOptions

func SearchOptionPage added in v0.4.0

func SearchOptionPage(page int) SearchOption

SearchOptionPage change page to retrive

type SearchOptions added in v0.4.0

type SearchOptions struct {
	Page int
}

SearchOptions for Search

type SearchResult

type SearchResult struct {
	JSON gjson.Result
}

SearchResult holds search data and provide useful methods.

func Search(ctx context.Context, query string, opts ...SearchOption) (result SearchResult, err error)

Search calls pixiv novel search api.

func (SearchResult) ForEach

func (r SearchResult) ForEach(iterator func(key, value gjson.Result) bool)

ForEach iterates through novel data items.

func (SearchResult) Novels

func (r SearchResult) Novels() []Novel

Novels appeared in the search result.

type Series

type Series struct {
	ID    string
	Title string
}

Series data

func (Series) URL added in v0.3.0

func (i Series) URL() *url.URL

URL to view web page.

func (Series) URLWithClient added in v0.3.0

func (i Series) URLWithClient(c client.Client) *url.URL

URLWithClient to view web page.

Jump to

Keyboard shortcuts

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