Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateRelevance ¶
func CalculateRelevance( tweets v1.TweetsResponse, timeFrame time.Frame, series int, ) (*storage.Relevance, error)
CalculateRelevance calculates relevance.
Types ¶
type Config ¶
type Config struct { AllTimeStatistics bool Series int DefaultTimeSpans time.Durations GeneratingInterval time.Duration }
Config represents a generator configuration.
func (*Config) MarshalLogObject ¶
func (cfg *Config) MarshalLogObject(enc zapcore.ObjectEncoder) error
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator represents a statistics generator.
func New ¶
func New(db storage.Statistical, twtsClient *tweets.Client, config Config, logger *zap.Logger) *Generator
New returns new generator.
func (*Generator) CalculateRelevances ¶
func (gen *Generator) CalculateRelevances(tweets v1.TweetsResponse) (storage.Relevances, error)
CalculateRelevances calculates the relevances for different time spans.
func (*Generator) GenerateRelevances ¶
GenerateRelevances gets all the tweets, generates relevance statistics for all time spans and updates the relevances in the database.
Click to show internal directories.
Click to hide internal directories.