Documentation
¶
Index ¶
- func EncodeBook(book *Book) ([]byte, error)
- func EncodeBooks(books []Book) ([]byte, error)
- type Book
- func (book *Book) Authors() []string
- func (book *Book) Description() string
- func (book *Book) ISBN() string
- func (book *Book) Id() string
- func (book *Book) ImageURL() string
- func (book *Book) IsValid() bool
- func (book *Book) Label() string
- func (book *Book) PublicationDate() Date
- func (book *Book) Publisher() string
- func (book *Book) SeriesTitle() string
- func (book *Book) String() string
- func (book *Book) SubTitle() string
- func (book *Book) Title() string
- type Client
- type ClientOptFunc
- type Date
- type Error
- type Hanmoto
- type Onix
- type Server
- type ServerOptFunc
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeBook ¶
EncodeBook returns bytes encoded from Book instance
func EncodeBooks ¶
EncodeBooks returns bytes encoded from list of Book
Types ¶
type Book ¶
type Book struct {
Onix Onix `json:"onix"`
Hanmoto Hanmoto `json:"hanmoto"`
Summary Summary `json:"summary"`
}
Book is entity class of book info.
func DecodeBook ¶
DecodeBook returns Book instance from byte buffer
func DecodeBooks ¶
DecodeBooks returns array of Book instance from byte buffer
func (*Book) Description ¶
Description returns strings of book description or table of content
func (*Book) PublicationDate ¶
PublicationDate returns Date of Publication
func (*Book) SeriesTitle ¶
SeriesTitle returns string of series title
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is http.Client for Aozora API Server
func DefaultClient ¶
func DefaultClient() *Client
DefaultClient returns new Client instance with default setting
func (*Client) LookupBooks ¶
LookupBooks gets books data (struct data)
func (*Client) LookupBooksContext ¶ added in v0.3.0
LookupBooksRawContext gets books data with context.Context. (struct data)
func (*Client) LookupBooksRaw ¶
LookupBooksRaw gets books data (raw data)
type ClientOptFunc ¶ added in v0.2.0
type ClientOptFunc func(*Client)
ClientOptFunc is self-referential function for functional options pattern
func WithContext ¶ added in v0.2.0
func WithContext(ctx context.Context) ClientOptFunc
WithContext is dummy function. Because this function is deprecated.
func WithHttpClient ¶ added in v0.2.1
func WithHttpClient(client *http.Client) ClientOptFunc
WithHttpClient returns function for setting http.Client
type Date ¶
Time is wrapper class of time.Time
func (*Date) MarshalJSON ¶
MarshalJSON returns time string with RFC3339 format
func (*Date) UnmarshalJSON ¶
UnmarshalJSON returns result of Unmarshal for json.Unmarshal()
type Hanmoto ¶
type Hanmoto struct {
DatePublished Date `json:"dateshuppan"`
DateModified Date `json:"datemodified"`
DateCreated Date `json:"datecreated"`
DateReleased Date `json:"datekoukai"`
IsLightNovel bool `json:"lanove,omitempty"`
HasReview bool `json:"hasshohyo,omitempty"`
Reviews []struct {
Reviewer string `json:"reviewer"`
Link string `json:"link"`
DateAppearance Date `json:"appearance"`
SourceKindID int `json:"kubun_id"`
SourceID int `json:"source_id"`
Source string `json:"source"`
PaperType string `json:"choyukan"`
PostUser string `json:"post_user"`
Han string `json:"han"`
Gou string `json:"gou"`
} `json:"reviews,omitempty"`
HasSample bool `json:"hastameshiyomi,omitempty"`
}
Hanmoto is entity class of Hanmoto dot com items
type Onix ¶
type Onix struct {
RecordReference string //ISBN code (key code)
NotificationType string
ProductIdentifier struct {
ProductIDType string
IDValue string //ISBN ?
}
DescriptiveDetail struct {
ProductComposition string
ProductForm string
Measure []struct {
MeasureType string
Measurement string
MeasureUnitCode string
} `json:",omitempty"`
Collection struct {
CollectionType string
CollectionSequence *struct {
CollectionSequenceType string `json:",omitempty"`
CollectionSequenceTypeName string `json:",omitempty"`
CollectionSequenceNumber string `json:",omitempty"`
} `json:",omitempty"`
TitleDetail *struct {
TitleType string `json:",omitempty"`
TitleElement []struct {
TitleElementLevel string
TitleText struct {
Content string `json:"content"`
CollationKey string `json:"collationkey,omitempty"`
}
} `json:",omitempty"`
} `json:",omitempty"`
}
TitleDetail struct {
TitleType string
TitleElement struct {
TitleElementLevel string
TitleText struct {
Content string `json:"content"`
Collationkey string `json:"collationkey,omitempty"`
}
}
}
Contributor []struct {
SequenceNumber string
ContributorRole []string `json:",omitempty"`
PersonName struct {
Content string `json:"content"`
Collationkey string `json:"collationkey,omitempty"`
}
BiographicalNote string `json:",omitempty"`
} `json:",omitempty"`
Language []struct {
LanguageRole string
LanguageCode string
CountryCode string
} `json:",omitempty"`
Extent []struct {
ExtentType string
ExtentValue string
ExtentUnit string
} `json:",omitempty"`
Subject []struct {
SubjectSchemeIdentifier string
SubjectCode string
SubjectHeadingText string `json:",omitempty"`
} `json:",omitempty"`
Audience []struct {
AudienceCodeType string
AudienceCodeValue string
} `json:",omitempty"`
}
CollateralDetail *struct {
TextContent []struct {
TextType string
ContentAudience string
Text string
} `json:",omitempty"`
SupportingResource []struct {
ResourceContentType string
ContentAudience string
ResourceMode string
ResourceVersion []struct {
ResourceForm string
ResourceVersionFeature []struct {
ResourceVersionFeatureType string
FeatureValue string
} `json:",omitempty"`
ResourceLink string
} `json:",omitempty"`
} `json:",omitempty"`
} `json:",omitempty"`
PublishingDetail struct {
Imprint struct {
ImprintIdentifier []struct {
ImprintIDType string
IDValue string
} `json:",omitempty"`
ImprintName string
}
Publisher struct {
PublisherIdentifier []struct {
PublisherIDType string
IDValue string
} `json:",omitempty"`
PublishingRole string
PublisherName string
}
PublishingDate []struct {
Date Date
PublishingDateRole string
} `json:",omitempty"`
}
ProductSupply struct {
SupplyDetail struct {
ReturnsConditions struct {
ReturnsCodeType string
ReturnsCode string
}
ProductAvailability string
Price []struct {
PriceType string
CurrencyCode string
PriceAmount string
} `json:",omitempty"`
}
}
}
Onix is entity class of JPRO-onix items
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is informations of openBD
func (*Server) CreateClient ¶
func (s *Server) CreateClient(opts ...ClientOptFunc) *Client
CreateClient returns new Client instance
type ServerOptFunc ¶
type ServerOptFunc func(*Server)
ServerOptFunc is self-referential function for functional options pattern
func WithScheme ¶
func WithScheme(scheme string) ServerOptFunc
WithScheme returns function for setting scheme
func WithServerName ¶
func WithServerName(host string) ServerOptFunc
WithServerName returns function for setting hostname
type Summary ¶
type Summary struct {
ISBN string `json:"isbn"`
Title string `json:"title"`
Volume string `json:"volume"`
Series string `json:"series"`
Publisher string `json:"publisher"`
PubDate Date `json:"pubdate"`
Author string `json:"author"`
Cover string `json:"cover"`
}
Summary is entity class of summary data