Documentation
¶
Index ¶
- func CleanupTitle(title, siteName string) string
- func Clip(s string, max int) string
- func WithBotUA(ua string) func(*Summaly)
- func WithLang(lang string) func(*Summaly)
- func WithNonBotUA(ua string) func(*Summaly)
- func WithRequireNonBot(nonbot []string) func(*Summaly)
- func WithUserAgent(ua string) func(*Summaly)
- type General
- type Option
- type Player
- type Summaly
- type Summarizer
- type Summary
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanupTitle ¶
CleanupTitle は title から siteName を除去する
func WithNonBotUA ¶
func WithRequireNonBot ¶
func WithUserAgent ¶
Types ¶
type Player ¶
type Player struct {
URL string `json:"url,omitempty"`
Width *any `json:"width,omitempty"`
Height *any `json:"height,omitempty"`
Allow []string `json:"allow,omitempty"`
}
TODO: 不要な部分はomitemptyでも良い?nullにしないとダメ?
type Summaly ¶
type Summaly struct {
URL *url.URL
Lang string
UserAgent string
BotUserAgent string
NonBotUserAgent string
RequireNonBot []string
Body []byte
Node *html.Node
Client *fetch.Client
}
func (*Summaly) ResolveUserAgent ¶
type Summarizer ¶
type Summarizer interface {
// contains filtered or unexported methods
}
type Summary ¶
type Summary struct {
Title string `json:"title"`
Icon string `json:"icon"`
Description string `json:"description"`
Thumbnail string `json:"thumbnail"`
Player *Player `json:"player,omitempty"`
Sitename string `json:"sitename"`
Sensitive bool `json:"sensitive"`
URL string `json:"url"`
}
TODO: 不要な部分はomitemptyでも良い?nullにしないとダメ?
Click to show internal directories.
Click to hide internal directories.