narrow

package module
v0.0.0-...-9ab6a4a Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2019 License: MIT Imports: 13 Imported by: 0

README

go-narrow

narou api client

Documentation

Index

Constants

View Source
const NarouAPIEndPoint = "https://api.syosetu.com/novelapi/api/"

NarouAPIEndPoint contains Narou novel api endpoit

View Source
const NarouR18APIEndPoint = "https://api.syosetu.com/novel18api/api/"

NarouR18APIEndPoint is Narou R18 novel api endpoint

View Source
const Version = "0.0.8"

Version contains library version

Variables

This section is empty.

Functions

This section is empty.

Types

type BigGenre

type BigGenre int

BigGenre stands for large category

const (
	BigGenreAll      BigGenre = 0
	BigGenreRenai    BigGenre = 1
	BigGenreFantasy  BigGenre = 2
	BigGenreBungei   BigGenre = 3
	BigGenreSF       BigGenre = 4
	BigGenreOther    BigGenre = 99
	BigGenreNonGenre BigGenre = 98
)

big genres

type Buntai

type Buntai int

Buntai stands indent style, empty lines rate. experimental

const (
	// 文体指定なし
	BuntaiAll Buntai = 0
	// 字下げされておらず、連続改行が多い作品
	BuntaiNoIndentManyEmptyLines Buntai = 1
	// 字下げされていないが、改行数は平均な作品
	BuntaiNoIndentAveraegEmpytLines Buntai = 2
	// 字下げが適切だが、連続改行が多い作品
	BuntaiIndentManyEmptyLines Buntai = 4
	// 字下げが適切でかつ改行数も平均な作品
	BuntaiIndentAverageEmptyLines Buntai = 6
)

buntais

type Client

type Client struct {
	// contains filtered or unexported fields
}

A Client fetch data from novel api

func NewClient

func NewClient() *Client

NewClient returns new novel api client

func (*Client) Fetch

func (c *Client) Fetch(ctx context.Context, params *FetchParams) (*FetchResult, error)

Fetch download novel contents

func (*Client) Search

func (c *Client) Search(ctx context.Context, params Params) (*SearchResult, error)

Search returns narou API result

type ContentLine

type ContentLine struct {
	// RawLine contains raw content such as `<p id="L42">ほげほげ</p>`
	RawLine string
}

ContentLine contains parsed line of content

type FetchPage

type FetchPage struct {
	Lines          []ContentLine
	Preface        []ContentLine
	Afterword      []ContentLine
	SubTitle       string
	ChapterTitle   *string
	PageNumber     int
	PublishDate    time.Time
	LastUpdateDate *time.Time
	// contains filtered or unexported fields
}

FetchPage contains fetched content

type FetchParams

type FetchParams struct {
	Site  FetchSite
	NCode string
	Page  int

	WithContent bool

	AllowOver18 bool
}

FetchParams used for fetch

func NewFetchParams

func NewFetchParams() *FetchParams

NewFetchParams returns new FetchParams

type FetchResult

type FetchResult struct {
	Site       FetchSite
	NCode      string
	NovelType  int
	PageCount  int
	Pages      []FetchPage
	Title      string
	WriterName string
	Abstruct   string
}

FetchResult contains fetch result

type FetchSite

type FetchSite int

FetchSite for site fetch from

const (
	FetchSiteNarou FetchSite = iota
	FetchSiteNocturne
	FetchSiteMidNight
	FetchSiteMoonLight
)

sites

type Genre

type Genre int

Genre is genre

const (
	GenreAll Genre = 0

	GenreRenaiIsekai   Genre = 101
	GenreRenaiGenjitsu Genre = 102

	GenreFantasyHighFantasy Genre = 201
	GenreFantasyLowFantasy  Genre = 202

	GenreBungeiJunbungaku Genre = 301
	GenreBungeiHumanDrama Genre = 302
	GenreBungeiHistory    Genre = 303
	GenreBungeiMistrey    Genre = 304
	GenreBungeiHorror     Genre = 305
	GenreBungeiAction     Genre = 306
	GenreBungeiComedy     Genre = 307

	GenreSFVRGame Genre = 401
	GenreSFSpace  Genre = 402
	GenreSFSF     Genre = 403
	GenreSFPanic  Genre = 404

	GenreOtherFairyTale Genre = 9901
	GenreOtherPoetry    Genre = 9902
	GenreOtherEssei     Genre = 9903
	GenreOtherReplay    Genre = 9904
	GenreOtherOther     Genre = 9999

	GenreNongenreNongenre Genre = 9801
)

genres

type LastUpType

type LastUpType int

LastUpType is 最終掲載日(general_lastup)で抽出

const (
	// LastUpTypeNone is default, no condition
	LastUpTypeNone LastUpType = iota
	// LastUpTypeTimeStamp means Unixtime stamp
	LastUpTypeTimeStamp
	LastUpTypeThisWeek
	LastUpTypeLastWeek
	LastUpTypeSevenDay
	LastUpTypeThisMonth
	LastUpTypeLastMonth
)

type NocGenre

type NocGenre int

NocGenre for nocturne or monlight

const (
	NocGenreAll            NocGenre = 0
	NocGenreNocturne       NocGenre = 1
	NocGenreMoonlightWomen NocGenre = 2
	NocGenreMoonlightBL    NocGenre = 3
	NocGenreMidnight       NocGenre = 4
)

nocgenres

type NovelInfo

type NovelInfo struct {
	// 小説名
	Title *string
	// Nコード
	NCode *string
	// ユーザーID (R18 では取得できないので*)
	UserID *string
	// 作者名
	Writer *string
	// あらすじ
	Story *string
	// 大ジャンル
	BigGenre *int
	// ジャンル
	Genre *int

	// Nocture or else, R18 only
	NocturneGenre *int

	//// 原作(未使用項目)
	//// Gensaku string
	// キーワード
	Keywords []string
	// 初回掲載日
	GeneralFirstUp *time.Time
	// 最終掲載日
	GeneralLastUp *time.Time
	// 連載か短編か
	NovelType *int
	// 連載中か
	End *int

	// 全掲載部分数
	GeneralAllNo *int
	// 文字数
	Length *int
	// 読了想定時間(文字数/500)
	Time *int
	// 長期連載停止中
	IsStop *bool
	// 必須キーワードに「R15」を含む(R18 では取得できないので*)
	IsR15 *bool
	// 必須キーワードにボーイズラブを含む
	IsBoysLove *bool
	// 必須キーワードにガールズラブを含む
	IsGirlsLove *bool
	// 必須キーワードに残酷な描写ありを含む
	IsZankoku *bool
	// 必須キーワードに異世界転生を含む
	IsTensei *bool
	// 必須キーワードに異世界転移を含む
	IsTenni *bool
	// pc_or_k
	PCOrK *int

	// 総合評価ポイント
	GlobalPoint *int
	// 日間ポイント
	DailyPoint *int
	// 週間ポイント
	WeeklyPoint *int
	// 月間ポイント
	MonthlyPoint *int
	// 四半期ポイント
	QuarterPoint *int
	// 年間ポイント
	YearlyPoint *int
	// (R18)ブックマーク数
	FavNovelCount *int
	// 感想数
	ImpressionCount *int
	// レビュー数
	ReviewCount *int
	// 評価点
	AllPoint *int
	// 評価者数
	AllHyokaCount *int
	// 挿絵の数
	SasieCount *int
	// 会話率(%)
	KaiwaRitu *int
	// 小説の更新日
	NovelUpdatedAt *time.Time
	// システム用最終更新日時
	UpdatedAt *time.Time

	// 週間ユニークユーザ数
	WeeklyUnique *int
	// contains filtered or unexported fields
}

NovelInfo contains a novel info

type NovelState

type NovelState int

NovelState represent status and type of novel

const (
	// NovelStateAll is default status
	NovelStateAll NovelState = iota
	// NovelStateShortStory means t:短編
	NovelStateShortStory
	// NovelStateRensaiRunning means r:連載中
	NovelStateRensaiRunning
	// NovelStateRensaiEnded means er:完結済連載小説
	NovelStateRensaiEnded
	// NovelStateRensaiAll means re:すべての連載小説(連載中および完結済)
	NovelStateRensaiAll
	// NovelStateShortAndRensaiEnded means ter:短編と完結済連載小説
	NovelStateShortAndRensaiEnded
)

type OrderItem

type OrderItem int

OrderItem is `order` param

const (
	// OrderItemNew is 新着順
	OrderItemNew OrderItem = iota
	// OrderItemFavNovelCount is ブックマーク数の多い順
	OrderItemFavNovelCount
	// OrderItemReviewCount is レビュー数の多い順
	OrderItemReviewCount
	// OrderItemHyoka is 総合ポイントの高い順
	OrderItemHyoka
	// OrderItemHyokaAsc is 総合ポイントの低い順
	OrderItemHyokaAsc
	// OrderItemImpressionCount is 感想の多い順
	OrderItemImpressionCount
	// OrderItemHyokaCount is 評価者数の多い順
	OrderItemHyokaCount
	// OrderItemHyokaCountAsc is 評価者数の少ない順
	OrderItemHyokaCountAsc
	// OrderItemWeekly is 週間ユニークユーザの多い順
	OrderItemWeekly
	// OrderItemLengthDesc is 小説本文の文字数が多い順
	OrderItemLengthDesc
	// OrderItemLengthAsc is 小説本文の文字数が少ない順
	OrderItemLengthAsc
	// OrderItemNCodeDesc is 新着投稿順
	OrderItemNCodeDesc
	// OrderItemOld is 更新が古い順
	OrderItemOld
)

type OutputField

type OutputField int

OutputField represents 'of' parameter

const (
	OutputFieldAll OutputField = iota
	OutputFieldTitle
	OutputFieldNCode
	OutputFieldUserID
	OutputFieldWriter
	OutputFieldStory
	OutputFieldBigGenre
	OutputFieldGenre
	OutputFieldKeyword
	OutputFieldGeneralFirstUp
	OutputFieldGeneralLastUp
	OutputFieldNovelType
	OutputFieldEnd
	OutputFieldGeneralAllNo
	OutputFieldLength
	OutputFieldTime
	OutputFieldIsStop
	OutputFieldIsR15
	OutputFieldIsBL
	OutputFieldIsGL
	OutputFieldIsZankoku
	OutputFieldIsTensei
	OutputFieldIsTenni
	OutputFieldPcOrK
	OutputFieldGlobalPoint
	OutputFieldFavNovelCount
	OutputFieldReviewCount
	OutputFieldAllPoint
	OutputFieldAllHyokaCount
	OutputFieldSasieCount
	OutputFieldKaiwaritu
	OutputFieldNovelUpdatedAt
	OutputFieldUpdatedAt

	OutputFieldNocGenre

	OutputFieldDailyPoint
	OutputFieldWeeklyPoint
	OutputFieldMonthlyPoint
	OutputFieldQuaterPoint
	OutputFieldYearlyPoint

	OutputFieldImpressionCount
)

type Params

type Params interface {
	ToURL() (*url.URL, error)
}

Params define search parameter object interface

type PickupState

type PickupState int

PickupState is for ispickup param

const (
	PickupStateNone PickupState = iota
	PickupStateNot
	PickupStatePickup
)

pickup state

type SearchField

type SearchField int

SearchField stands for search word field

const (
	SearchFieldAll SearchField = iota
	SearchFieldTitle
	SearchFieldStory
	SearchFieldKeyword
	SearchFieldWriter
)

search fields

type SearchParams

type SearchParams struct {
	// contains filtered or unexported fields
}

SearchParams contains API search parameters

func NewSearchParams

func NewSearchParams() *SearchParams

NewSearchParams return new search parameter object

func (*SearchParams) AddBigGenres

func (params *SearchParams) AddBigGenres(genres []BigGenre)

AddBigGenres add BigGenre settings

func (*SearchParams) AddBuntais

func (params *SearchParams) AddBuntais(buntais []Buntai)

AddBuntais add buntai setting

func (*SearchParams) AddGenres

func (params *SearchParams) AddGenres(genres []Genre)

AddGenres add genre setting

func (*SearchParams) AddNCodes

func (params *SearchParams) AddNCodes(ncodes []string)

AddNCodes add search ncodes

func (*SearchParams) AddNotBigGenres

func (params *SearchParams) AddNotBigGenres(genres []BigGenre)

AddNotBigGenres add not biggenres setting

func (*SearchParams) AddNotGenres

func (params *SearchParams) AddNotGenres(genres []Genre)

AddNotGenres add genre setting

func (*SearchParams) AddNotWords

func (params *SearchParams) AddNotWords(words []string)

AddNotWords add search ignore words

func (*SearchParams) AddOutputFields

func (params *SearchParams) AddOutputFields(fields []OutputField)

AddOutputFields add OutputFields

func (*SearchParams) AddSearchFields

func (params *SearchParams) AddSearchFields(fields []SearchField)

AddSearchFields add search fields

func (*SearchParams) AddUserIDs

func (params *SearchParams) AddUserIDs(users []int)

AddUserIDs add search user ids

func (*SearchParams) AddWords

func (params *SearchParams) AddWords(words []string)

AddWords add search words

func (*SearchParams) BigGenres

func (params *SearchParams) BigGenres() []BigGenre

BigGenres returns `biggenre` parameter

func (*SearchParams) Buntais

func (params *SearchParams) Buntais() []Buntai

Buntais return `buntai` params

func (*SearchParams) ClearBigGenres

func (params *SearchParams) ClearBigGenres()

ClearBigGenres clear not word fields setting

func (*SearchParams) ClearBuntais

func (params *SearchParams) ClearBuntais()

ClearBuntais clear not word fields setting

func (*SearchParams) ClearGenres

func (params *SearchParams) ClearGenres()

ClearGenres clear not word fields setting

func (*SearchParams) ClearKaiwaritu

func (params *SearchParams) ClearKaiwaritu()

ClearKaiwaritu unset kaiwaritu parameter

func (*SearchParams) ClearLastUp

func (params *SearchParams) ClearLastUp()

ClearLastUp clear `lastup` param

func (*SearchParams) ClearLength

func (params *SearchParams) ClearLength()

ClearLength unset length parameter

func (*SearchParams) ClearLimit

func (params *SearchParams) ClearLimit()

ClearLimit clear `lim` parameter

func (*SearchParams) ClearMaxKaiwaritu

func (params *SearchParams) ClearMaxKaiwaritu()

ClearMaxKaiwaritu unset maxKaiwaritu parameter

func (*SearchParams) ClearMaxLength

func (params *SearchParams) ClearMaxLength()

ClearMaxLength unset maxLength parameter

func (*SearchParams) ClearMaxReadTime

func (params *SearchParams) ClearMaxReadTime()

ClearMaxReadTime unset `time` max parameter

func (*SearchParams) ClearMaxSasie

func (params *SearchParams) ClearMaxSasie()

ClearMaxSasie unset maxSasie parameter

func (*SearchParams) ClearMinKaiwaritu

func (params *SearchParams) ClearMinKaiwaritu()

ClearMinKaiwaritu unset minKaiwaritu parameter

func (*SearchParams) ClearMinLength

func (params *SearchParams) ClearMinLength()

ClearMinLength unset minLength parameter

func (*SearchParams) ClearMinReadTime

func (params *SearchParams) ClearMinReadTime()

ClearMinReadTime unset `time` min parameter

func (*SearchParams) ClearMinSasie

func (params *SearchParams) ClearMinSasie()

ClearMinSasie unset minSasie parameter

func (*SearchParams) ClearNCodes

func (params *SearchParams) ClearNCodes()

ClearNCodes clear search NCode fields setting

func (*SearchParams) ClearNotBigGenres

func (params *SearchParams) ClearNotBigGenres()

ClearNotBigGenres clear not word fields setting

func (*SearchParams) ClearNotGenres

func (params *SearchParams) ClearNotGenres()

ClearNotGenres clear not word fields setting

func (*SearchParams) ClearNotWords

func (params *SearchParams) ClearNotWords()

ClearNotWords clear not word fields setting

func (*SearchParams) ClearNovelState

func (params *SearchParams) ClearNovelState()

ClearNovelState clear `type` parameter

func (*SearchParams) ClearOrder

func (params *SearchParams) ClearOrder()

ClearOrder clear `order` param

func (*SearchParams) ClearOutputFields

func (params *SearchParams) ClearOutputFields()

ClearOutputFields clear output fields setting

func (*SearchParams) ClearPickupState

func (params *SearchParams) ClearPickupState()

ClearPickupState clear `ispickup` param

func (*SearchParams) ClearReadTime

func (params *SearchParams) ClearReadTime()

ClearReadTime unset `time` parameter

func (*SearchParams) ClearSasie

func (params *SearchParams) ClearSasie()

ClearSasie unset sasie parameter

func (*SearchParams) ClearSearchFields

func (params *SearchParams) ClearSearchFields()

ClearSearchFields clear not word fields setting

func (*SearchParams) ClearStart

func (params *SearchParams) ClearStart()

ClearStart clear `st` (offset) parameter

func (*SearchParams) ClearStopState

func (params *SearchParams) ClearStopState()

ClearStopState clear `stop` parameter

func (*SearchParams) ClearUserIDs

func (params *SearchParams) ClearUserIDs()

ClearUserIDs clear user id fields setting

func (*SearchParams) ClearWithWeeklyUnique

func (params *SearchParams) ClearWithWeeklyUnique()

ClearWithWeeklyUnique clear `opt=weekly` query

func (*SearchParams) ClearWords

func (params *SearchParams) ClearWords()

ClearWords clear search word fields setting

func (*SearchParams) Genres

func (params *SearchParams) Genres() []Genre

Genres returns `genre` parameter

func (*SearchParams) IsBL

func (params *SearchParams) IsBL() bool

IsBL return BL flag

func (*SearchParams) IsGL

func (params *SearchParams) IsGL() bool

IsGL return GL flag

func (*SearchParams) IsNotBL

func (params *SearchParams) IsNotBL() bool

IsNotBL return not BL flag

func (*SearchParams) IsNotGL

func (params *SearchParams) IsNotGL() bool

IsNotGL return not GL flag

func (*SearchParams) IsNotR15

func (params *SearchParams) IsNotR15() bool

IsNotR15 return not r15 flag

func (*SearchParams) IsNotTenni

func (params *SearchParams) IsNotTenni() bool

IsNotTenni return not Tenni flag

func (*SearchParams) IsNotTensei

func (params *SearchParams) IsNotTensei() bool

IsNotTensei return not Tensei flag

func (*SearchParams) IsNotZankoku

func (params *SearchParams) IsNotZankoku() bool

IsNotZankoku return not Zankoku flag

func (*SearchParams) IsR15

func (params *SearchParams) IsR15() bool

IsR15 return r15 flag

func (*SearchParams) IsTT

func (params *SearchParams) IsTT() bool

IsTT return Tenni or Tensei flag

func (*SearchParams) IsTenni

func (params *SearchParams) IsTenni() bool

IsTenni return Tenni flag

func (*SearchParams) IsTensei

func (params *SearchParams) IsTensei() bool

IsTensei return Tensei flag

func (*SearchParams) IsZankoku

func (params *SearchParams) IsZankoku() bool

IsZankoku return Zankoku flag

func (*SearchParams) Kaiwaritu

func (params *SearchParams) Kaiwaritu() *int

Kaiwaritu returns `kaiwaritu` parameter

func (*SearchParams) LastUpTimeStamps

func (params *SearchParams) LastUpTimeStamps() [2]time.Time

LastUpTimeStamps return `lastup` timestamp Start/End

func (*SearchParams) LastUpType

func (params *SearchParams) LastUpType() LastUpType

LastUpType returns `lastup` parameter,

func (*SearchParams) Length

func (params *SearchParams) Length() *int

Length return `length` parameter if set, or nil

func (*SearchParams) Limit

func (params *SearchParams) Limit() int

Limit return `lim` parameter

func (*SearchParams) MaxKaiwaritu

func (params *SearchParams) MaxKaiwaritu() *int

MaxKaiwaritu returns `kaiwaritu` max parameter

func (*SearchParams) MaxLength

func (params *SearchParams) MaxLength() *int

MaxLength return `maxlen` parameter if set, or nil

func (*SearchParams) MaxReadTime

func (params *SearchParams) MaxReadTime() *int

MaxReadTime returns `time` max parameter

func (*SearchParams) MaxSasie

func (params *SearchParams) MaxSasie() *int

MaxSasie returns `sasie` max parameter

func (*SearchParams) MinKaiwaritu

func (params *SearchParams) MinKaiwaritu() *int

MinKaiwaritu returns `kaiwaritu` min parameter

func (*SearchParams) MinLength

func (params *SearchParams) MinLength() *int

MinLength return `minlen` parameter if set, or nil

func (*SearchParams) MinReadTime

func (params *SearchParams) MinReadTime() *int

MinReadTime returns `time` min parameter

func (*SearchParams) MinSasie

func (params *SearchParams) MinSasie() *int

MinSasie returns `sasie` min parameter

func (*SearchParams) NCodes

func (params *SearchParams) NCodes() []string

NCodes returns `ncode` param

func (*SearchParams) NotBigGenres

func (params *SearchParams) NotBigGenres() []BigGenre

NotBigGenres returns `notbiggenre` parameter

func (*SearchParams) NotGenres

func (params *SearchParams) NotGenres() []Genre

NotGenres returns `notgenre` parameter

func (*SearchParams) NotWords

func (params *SearchParams) NotWords() []string

NotWords return `notword` parameter

func (*SearchParams) NovelState

func (params *SearchParams) NovelState() NovelState

NovelState return `type` parameter

func (*SearchParams) Order

func (params *SearchParams) Order() OrderItem

Order return `order`

func (*SearchParams) OutputFields

func (params *SearchParams) OutputFields() []OutputField

OutputFields rturn `of` parameters

func (*SearchParams) PickupState

func (params *SearchParams) PickupState() PickupState

PickupState return `ispickup` parameter

func (*SearchParams) ReadTime

func (params *SearchParams) ReadTime() *int

ReadTime returns `time` max parameter

func (*SearchParams) Sasie

func (params *SearchParams) Sasie() *int

Sasie returns `sasie` parameter

func (*SearchParams) SearchFields

func (params *SearchParams) SearchFields() []SearchField

SearchFields return search fields

func (*SearchParams) SetIsBL

func (params *SearchParams) SetIsBL(bl bool)

SetIsBL set bl flag, reset not-bl flag

func (*SearchParams) SetIsGL

func (params *SearchParams) SetIsGL(gl bool)

SetIsGL set gl flag, reset not-gl flag

func (*SearchParams) SetIsNotBL

func (params *SearchParams) SetIsNotBL(bl bool)

SetIsNotBL set not bl flag, reset bl flag

func (*SearchParams) SetIsNotGL

func (params *SearchParams) SetIsNotGL(gl bool)

SetIsNotGL set not gl flag, reset gl flag

func (*SearchParams) SetIsNotR15

func (params *SearchParams) SetIsNotR15(r15 bool)

SetIsNotR15 set not r15 flag, reset r15 flag

func (*SearchParams) SetIsNotTenni

func (params *SearchParams) SetIsNotTenni(tenni bool)

SetIsNotTenni set not tenni flag, reset tenni flag

func (*SearchParams) SetIsNotTensei

func (params *SearchParams) SetIsNotTensei(tensei bool)

SetIsNotTensei set not tensei flag, reset tensei flag

func (*SearchParams) SetIsNotZankoku

func (params *SearchParams) SetIsNotZankoku(zankoku bool)

SetIsNotZankoku set not zankoku flag, reset zankoku flag

func (*SearchParams) SetIsR15

func (params *SearchParams) SetIsR15(r15 bool)

SetIsR15 set r15 flag, reset not-r15 flag

func (*SearchParams) SetIsTT

func (params *SearchParams) SetIsTT(tt bool)

SetIsTT set tt flag,

func (*SearchParams) SetIsTenni

func (params *SearchParams) SetIsTenni(tenni bool)

SetIsTenni set tenni flag, reset not-tenni flag

func (*SearchParams) SetIsTensei

func (params *SearchParams) SetIsTensei(tensei bool)

SetIsTensei set tensei flag, reset not-tensei flag

func (*SearchParams) SetIsZankoku

func (params *SearchParams) SetIsZankoku(zankoku bool)

SetIsZankoku set zankoku flag, reset not-zankoku flag

func (*SearchParams) SetKaiwaritu

func (params *SearchParams) SetKaiwaritu(kaiwa int)

SetKaiwaritu set kaiwaritu parameter

func (*SearchParams) SetLastUp

func (params *SearchParams) SetLastUp(ltype LastUpType)

SetLastUp set `lastup` params

func (*SearchParams) SetLastUpTerm

func (params *SearchParams) SetLastUpTerm(start, end time.Time)

SetLastUpTerm set `lastup` timestamp

func (*SearchParams) SetLength

func (params *SearchParams) SetLength(len int)

SetLength set length parameter

func (*SearchParams) SetLimit

func (params *SearchParams) SetLimit(limit int)

SetLimit set `lim` parameter

func (*SearchParams) SetMaxKaiwaritu

func (params *SearchParams) SetMaxKaiwaritu(maxKaiwa int)

SetMaxKaiwaritu set maxkaiwaritu parameter

func (*SearchParams) SetMaxLength

func (params *SearchParams) SetMaxLength(maxLen int)

SetMaxLength set maxlength parameter

func (*SearchParams) SetMaxReadTime

func (params *SearchParams) SetMaxReadTime(maxRt int)

SetMaxReadTime set `time` max parameter

func (*SearchParams) SetMaxSasie

func (params *SearchParams) SetMaxSasie(maxSasie int)

SetMaxSasie set maxsasie parameter

func (*SearchParams) SetMinKaiwaritu

func (params *SearchParams) SetMinKaiwaritu(minKaiwa int)

SetMinKaiwaritu set minKaiwaritu parameter

func (*SearchParams) SetMinLength

func (params *SearchParams) SetMinLength(minLen int)

SetMinLength set minLength parameter

func (*SearchParams) SetMinReadTime

func (params *SearchParams) SetMinReadTime(minRt int)

SetMinReadTime set `time` min parameter

func (*SearchParams) SetMinSasie

func (params *SearchParams) SetMinSasie(minSasie int)

SetMinSasie set minSasie parameter

func (*SearchParams) SetNovelState

func (params *SearchParams) SetNovelState(state NovelState)

SetNovelState set `type` parameter

func (*SearchParams) SetOrder

func (params *SearchParams) SetOrder(order OrderItem)

SetOrder set `order` param

func (*SearchParams) SetPickupState

func (params *SearchParams) SetPickupState(pickup PickupState)

SetPickupState set `ispickup` param

func (*SearchParams) SetReadTime

func (params *SearchParams) SetReadTime(rt int)

SetReadTime set readTime parameter

func (*SearchParams) SetSasie

func (params *SearchParams) SetSasie(sasie int)

SetSasie set sasie parameter

func (*SearchParams) SetStart

func (params *SearchParams) SetStart(start int)

SetStart set `st` (offset) parameter

func (*SearchParams) SetStopState

func (params *SearchParams) SetStopState(state StopState)

SetStopState set `stop` parameter

func (*SearchParams) SetWithWeeklyUnique

func (params *SearchParams) SetWithWeeklyUnique(f bool)

SetWithWeeklyUnique set `opt=weekly` query

func (*SearchParams) Start

func (params *SearchParams) Start() int

Start return `st` (offset) parameter

func (*SearchParams) StopState

func (params *SearchParams) StopState() StopState

StopState returns `stop` param

func (*SearchParams) ToURL

func (params *SearchParams) ToURL() (*url.URL, error)

ToURL return full URL or nil if params contains invalid condition

func (*SearchParams) UserIDs

func (params *SearchParams) UserIDs() []int

UserIDs return `userid` param

func (*SearchParams) Valid

func (params *SearchParams) Valid() (bool, error)

Valid returns params is OK or not

func (*SearchParams) WithWeeklyUnique

func (params *SearchParams) WithWeeklyUnique() bool

WithWeeklyUnique returns wether opt=weekly or not

func (*SearchParams) Words

func (params *SearchParams) Words() []string

Words return `word` parameter

type SearchR18Params

type SearchR18Params struct {
	SearchParams
	// contains filtered or unexported fields
}

SearchR18Params used for R18API

func NewSearchR18Params

func NewSearchR18Params() *SearchR18Params

NewSearchR18Params return new search r18 api parameter object

func (*SearchR18Params) AddNocGenres

func (params *SearchR18Params) AddNocGenres(genres []NocGenre)

AddNocGenres add NocGenre settings

func (*SearchR18Params) AddNotNocGenres

func (params *SearchR18Params) AddNotNocGenres(genres []NocGenre)

AddNotNocGenres add not biggenres setting

func (*SearchR18Params) ClearNocGenres

func (params *SearchR18Params) ClearNocGenres()

ClearNocGenres clear not word fields setting

func (*SearchR18Params) ClearNotNocGenres

func (params *SearchR18Params) ClearNotNocGenres()

ClearNotNocGenres clear not word fields setting

func (*SearchR18Params) NocGenres

func (params *SearchR18Params) NocGenres() []NocGenre

NocGenres returns `NocGenre` parameter

func (*SearchR18Params) NotNocGenres

func (params *SearchR18Params) NotNocGenres() []NocGenre

NotNocGenres returns `notnocgenre` parameter

func (*SearchR18Params) ToURL

func (params *SearchR18Params) ToURL() (*url.URL, error)

ToURL return full URL or nil if params contains invalid condition

type SearchResult

type SearchResult struct {
	// AllCount is number of novels that search parameter matched, not `len(NovelInfos)`
	AllCount int
	// NovelInfos are contains search result
	NovelInfos []NovelInfo
}

SearchResult contains fetch result

type StopState

type StopState int

StopState is 連載停止中作品に関する指定

const (
	// StopStateAll is 指定なし
	StopStateAll StopState = 0
	// StopStateExclude is 長期連載停止中を除きます
	StopStateExclude StopState = 1
	// StopStateOnly  is 長期連載停止中のみ取得します
	StopStateOnly StopState = 2
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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