Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoTops = errors.New("no top tweets") ErrNotFound = errors.New("not found") )
Functions ¶
This section is empty.
Types ¶
type ConfigProxies ¶ added in v0.0.20
type ConfigProxies struct { Port string `envconfig:"PROXY_PORT"` Addresses []string `envconfig:"PROXY_ADDRESSES"` Username string `envconfig:"PROXY_USERNAME"` Password string `envconfig:"PROXY_PASSWORD"` }
func GetConfigPool ¶
func GetConfigPool() ConfigProxies
func (ConfigProxies) GetProxies ¶ added in v0.0.20
func (c ConfigProxies) GetProxies() []string
type Finder ¶
type Finder interface { FindNext(ctx context.Context, start, end *time.Time, search, cursor string) ([]common.TweetSnapshot, string, error) Find(ctx context.Context, id string) (*common.TweetSnapshot, error) CurrentDelay() int64 CurrentTemp(ctx context.Context) float64 Init(ctx context.Context) error }
func NewFinder ¶
func NewFinder(scraper *twitterscraper.Scraper, delayManager delayManager, logger log.Logger) Finder
func NewMetricMiddleware ¶
func NewMetricMiddleware(one, nextHist *prometheus.HistogramVec, login string, next Finder) Finder
func NewPool ¶
func NewPool(metricsOne, metricsNext *prometheus.HistogramVec, metricsDelay *prometheus.GaugeVec, config ConfigProxies, manager accountManager, db repo, logger log.Logger) Finder
type Manager ¶
type Manager interface { TooManyRequests(ctx context.Context) AfterRequest() CurrentDelay() int64 CurrentTemp(ctx context.Context) float64 Start(ctx context.Context) error }
func NewDelayManagerV2 ¶
type WindowLimiter ¶
type WindowLimiter interface { Inc() TrySetThreshold(ctx context.Context, startTime time.Time) error Duration() time.Duration RecommendedDelay(ctx context.Context) (uint64, error) SetResetLimiter(resetLimiter windowlimiter.ResetLimiter) Threshold(ctx context.Context) uint64 Temp(ctx context.Context) float64 Start(ctx context.Context, delay int64) error }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.