Documentation ¶
Index ¶
- Variables
- func ExtractChannelSlug(channelURL string) (slug string, ok bool)
- func IsValidChannelSlug(channelSlug string) bool
- type ConfigOption
- type Crawler
- func (cr *Crawler) CheckIVS(ctx context.Context, playbackURL string) (available bool, tokenValid bool, err error)
- func (cr *Crawler) FetchChannel(ctx context.Context, channelSlug string) (channel *api.Channel, err error)
- func (cr *Crawler) SetSettings(settings CrawlerSettings)
- func (cr *Crawler) Settings() CrawlerSettings
- type CrawlerSettings
- type EntityData
- type Handle
- type HandleType
- type OrderData
Constants ¶
This section is empty.
Variables ¶
View Source
var ( NilConfig = errors.New("config is nil") NilClient = errors.New("client is nil") )
View Source
var ( InvalidChannelSlug = errors.New("invalid channel slug") InvalidPlaybackURL = errors.New("invalid playback URL") UnexpectedIVSResponse = errors.New("unexpected IVS response") )
View Source
var DefaultSettings = CrawlerSettings{ CrawlerSettings: crawly.DefaultCrawlerSettings, MaximumChannelPlaybackURLAge: 50 * time.Minute, MinimumFetchChannelDelay: 5 * time.Minute, }
Functions ¶
func ExtractChannelSlug ¶
func IsValidChannelSlug ¶
Types ¶
type ConfigOption ¶
type ConfigOption func(cfg *config)
func WithAPIClient ¶
func WithAPIClient(apiClient cclient.APIClient) ConfigOption
func WithClient ¶
func WithClient(client cclient.Client) ConfigOption
func WithLogger ¶
func WithLogger(logger *slog.Logger) ConfigOption
func WithSettings ¶
func WithSettings(settings CrawlerSettings) ConfigOption
type Crawler ¶
func NewCrawler ¶
func NewCrawler(opts ...ConfigOption) (*Crawler, error)
func (*Crawler) FetchChannel ¶
func (*Crawler) SetSettings ¶
func (cr *Crawler) SetSettings(settings CrawlerSettings)
func (*Crawler) Settings ¶
func (cr *Crawler) Settings() CrawlerSettings
type CrawlerSettings ¶
type EntityData ¶
type HandleType ¶
type HandleType uint
const (
HandleChannelSlug HandleType = (iota + 1)
)
func (HandleType) String ¶
func (ht HandleType) String() string
Source Files ¶
Click to show internal directories.
Click to hide internal directories.