Documentation
¶
Index ¶
- Constants
- func AddNewApp(ctx context.Context, element *App, col *mongo.Collection) error
- func Flush(ctx context.Context, col *mongo.Collection) error
- func GetJobParams(cfg *config.Config, jobType int) (int, *mongo.Cursor, error)
- func SetTrackFlag(ctx context.Context, id primitive.ObjectID, val bool, col *mongo.Collection) error
- func UpdateApp(ctx context.Context, app *App, col *mongo.Collection) error
- type App
- type DailyMetric
- type Metric
- type StaticAppData
Constants ¶
View Source
const ( DBTIMEOUT = 10 CAPACITY = 200000 DAILY = 0 MONTHLY = 1 RECOVERY = 2 REFRESH = 3 TRACK = 4 )
DB Constants
Variables ¶
This section is empty.
Functions ¶
func SetTrackFlag ¶
Types ¶
type App ¶
type App struct { ID primitive.ObjectID `bson:"_id,omitempty"` Metrics []Metric `bson:"metrics"` DailyMetrics []DailyMetric `bson:"daily_metrics"` StaticData StaticAppData `bson:"static_data"` Tracked bool `bson:"tracked"` LastMetric DailyMetric `bson:"last_metric"` }
type DailyMetric ¶
DailyMetric - Metric obj
type Metric ¶
type Metric struct { Date time.Time `bson:"date"` AvgPlayers int `bson:"avgplayers"` Gain string `bson:"gain"` GainPercent string `bson:"gainpercent"` Peak int `bson:"peak"` }
Metric element
type StaticAppData ¶
type StaticAppData struct { Name string `bson:"name"` AppID int `bson:"app_id"` Domain string `bson:"domain"` }
func GetFullStaticData ¶
func GetFullStaticData(ctx context.Context, col *mongo.Collection) ([]StaticAppData, error)
Click to show internal directories.
Click to hide internal directories.