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 ConfigPool ¶
type ConfigPool struct {
Proxies []string `envconfig:"PROXIES"`
}
func GetConfigPool ¶
func GetConfigPool() ConfigPool
type Finder ¶
type Finder interface { FindAll(ctx context.Context, start, end *time.Time, search string) ([]common.TweetSnapshot, error) Find(ctx context.Context, id string) (*common.TweetSnapshot, error) CurrentDelay() int64 Init(ctx context.Context) error }
func NewFinder ¶
func NewFinder(scraper *twitterscraper.Scraper, delayManager delayManager, logger log.Logger) Finder
func NewMetricMiddleware ¶
func NewMetricMiddleware(all, one *prometheus.HistogramVec, login string, next Finder) Finder
func NewPool ¶
func NewPool(metricsAll, metricsOne *prometheus.HistogramVec, config ConfigPool, manager accountManager, db repo, logger log.Logger) Finder
type Manager ¶
type Manager interface { TooManyRequests(ctx context.Context) AfterRequest() ProcessedQuery() SetSetterFn(func(seconds int64)) CurrentDelay() int64 Start(ctx context.Context) error }
func NewDelayManagerV2 ¶
type WindowLimiter ¶
type WindowLimiter interface { Inc() TrySetThreshold(ctx context.Context, startTime time.Time) error Duration() time.Duration TooFast(ctx context.Context) (uint64, error) SetResetLimiter(resetLimiter windowlimiter.ResetLimiter) Threshold(ctx context.Context) uint64 Start(ctx context.Context, delay int64) error }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.