Documentation ¶
Index ¶
- Variables
- func FindSourceURL(text string) string
- func GetArtworkInfo(sourceURL string) (*types.Artwork, error)
- func GetFileName(artwork *types.Artwork, picture *types.Picture) (string, error)
- func GetPixivRegularURL(original string) string
- func InitSources()
- func MatchesSourceURL(text string) bool
- type Source
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Sources = make(map[types.SourceType]Source) SourceURLRegexps = make(map[types.SourceType]*regexp.Regexp) )
Functions ¶
func FindSourceURL ¶
func GetPixivRegularURL ¶
func InitSources ¶
func InitSources()
func MatchesSourceURL ¶
MatchesSourceURL returns whether the text contains a source URL.
Types ¶
type Source ¶
type Source interface { Init() FetchNewArtworksWithCh(artworkCh chan *types.Artwork, limit int) error FetchNewArtworks(limit int) ([]*types.Artwork, error) GetArtworkInfo(sourceURL string) (*types.Artwork, error) GetPictureInfo(sourceURL string, index uint) (*types.Picture, error) GetSourceURLRegexp() *regexp.Regexp // CommonSourceURl should has prefix "https://" GetCommonSourceURL(url string) string // FileName 返回图片的用于存储和传输的文件名 GetFileName(artwork *types.Artwork, picture *types.Picture) string Config() *config.SourceCommonConfig }
Click to show internal directories.
Click to hide internal directories.