model

package
v0.0.0-...-8f4005c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArticleContent

type ArticleContent struct {
	Path     string        `json:"path"`
	Sections []string      `json:"sections"`
	Stats    *ArticleStats `json: "stats"`
	Title    string        `json:"title"`
	Authors  []string      `json:"authors"`
}

type ArticleStats

type ArticleStats struct {
	Visits  int          `json:"visits"`
	Loyalty LoyaltyStats `json:"loyalty"`
}

type LoyaltyStats

type LoyaltyStats struct {
	New       int `bson:"new"`
	Loyal     int `bson:"loyal"`
	Returning int `bson:"returning"`
}

type MobileSeries

type MobileSeries struct {
	Id        bson.ObjectId `bson:"_id,omitempty"`
	Date      time.Time     `bson:"date"`
	StartTime time.Time     `bson:"startTime"`
	Series    []int         `bson:"series"`
}

func (*MobileSeries) AddSeriesValue

func (m *MobileSeries) AddSeriesValue(value int)

func (MobileSeries) Save

func (m MobileSeries) Save(session *mgo.Session)

type PlatformStats

type PlatformStats struct {
	M int `bson:"m"`
	T int `bson:"t"`
	D int `bson:"d"`
	A int `bson:"a"`
}

type QuickStats

type QuickStats struct {
	Source          string        `bson:source`
	Visits          int           `bson:"visits"`
	Links           int           `bson:"links"`
	Direct          int           `bson:"direct"`
	Search          int           `bson:"search"`
	Social          int           `bson:"social"`
	Recirc          int           `bson:"recirc"`
	Article         int           `bson:"article"`
	PlatformEngaged PlatformStats `json:"platform_engaged"bson:"platform_engaged"`
	Loyalty         LoyaltyStats  `bson:"loyalty"`
}

type QuickStatsResp

type QuickStatsResp struct {
	Data *QuickStatsRespStats `bson:"data"`
}

type QuickStatsRespStats

type QuickStatsRespStats struct {
	Stats *QuickStats `bson:"stats"`
}

type QuickStatsSnapshot

type QuickStatsSnapshot struct {
	Id         bson.ObjectId `bson:"_id,omitempty"`
	Created_at time.Time     `bson:"created_at"`
	Stats      []*QuickStats `bson:"stats"`
}

func (QuickStatsSnapshot) Save

func (q QuickStatsSnapshot) Save(session *mgo.Session)

Snapshot interface

type Recent

type Recent struct {
	Lat      float32 `json:"lat" bson:"lat"`
	Lng      float32 `json:"lng" bson:"lng"`
	Title    string  `json:"title" bson:"title"`
	Url      string  `json:"path" bson"url"`
	Host     string  `json:"domain" bson:"host"`
	Platform string
}

type RecentResp

type RecentResp struct {
	Source  string
	Recents []Recent
}

type RecentSnapshot

type RecentSnapshot struct {
	Id         bson.ObjectId `bson:"_id,omitempty"`
	Created_at time.Time     `bson:"created_at"`
	Recents    []*RecentResp `bson:"recents"`
}

func (RecentSnapshot) Save

func (r RecentSnapshot) Save(session *mgo.Session)

type Referrers

type Referrers struct {
	Source    string `json:"source"`
	Referrers bson.M `bson:"referrers" json:"referrers"`
}

type ReferrersSnapshot

type ReferrersSnapshot struct {
	Id         bson.ObjectId `bson:"_id,omitempty"`
	Created_at time.Time     `bson:"created_at"`
	Referrers  []*Referrers  `bson:"referrers"`
}

func (ReferrersSnapshot) Save

func (r ReferrersSnapshot) Save(session *mgo.Session)

type Snapshot

type Snapshot interface {
	Save(session *mgo.Session)
}

type TopArticle

type TopArticle struct {
	Id        bson.ObjectId `bson:"_id,omitempty"`
	ArticleId int           `bson:"article_id"`
	Headline  string        `bson:"headline"`
	Url       string        `bson:"url"`
	Authors   []string      `bson:"authors"`
	Source    string        `bson:"source"`
	Sections  []string      `bson:"sections"`
	Visits    int           `bson:"visits"`
	Loyalty   LoyaltyStats  `json:"loyalty"`
}

type TopGeo

type TopGeo struct {
	Source string `bson:"source"`
	Cities bson.M `bson:"cities"`
}

type TopGeoResp

type TopGeoResp struct {
	Geo TopGeo `bson:"geo:"`
}

type TopGeoSnapshot

type TopGeoSnapshot struct {
	Id         bson.ObjectId `bson:"_id,omitempty"`
	Created_at time.Time     `bson:"created_at"`
	Cities     []*TopGeo     `bson:"cities"`
}

func (TopGeoSnapshot) Save

func (t TopGeoSnapshot) Save(session *mgo.Session)

type TopPages

type TopPages struct {
	Site  string
	Pages []*ArticleContent `json:"pages"`
}

* DATA COMING IN

type TopPagesSnapshot

type TopPagesSnapshot struct {
	Document TopPagesSnapshotDocument
	Articles []*m.Article
}

Because toppages saves articles in addition to a Snapshot, need a second storage container for the snapshot alone

func (TopPagesSnapshot) Save

func (t TopPagesSnapshot) Save(session *mgo.Session)

type TopPagesSnapshotDocument

type TopPagesSnapshotDocument struct {
	Id         bson.ObjectId `bson:"_id,omitempty"`
	Created_at time.Time     `bson:"created_at"`
	Articles   []*TopArticle `bson:"articles"`
}

* DATA GOING OUT

type Traffic

type Traffic struct {
	Source string `bson:"source"`
	Visits []int  `bson:"visits"`
}

type TrafficSeriesIn

type TrafficSeriesIn struct {
	Series *struct {
		People []int `json:"people"`
	} `json:"series"`
}

func (*TrafficSeriesIn) Visits

func (his *TrafficSeriesIn) Visits() []int

type TrafficSeriesSnapshot

type TrafficSeriesSnapshot struct {
	Id         bson.ObjectId `bson:"_id,omitempty"`
	Created_at time.Time     `bson:"created_at"`
	Start      int           `bson:"start"`
	End        int           `bson:"end"`
	Frequency  int           `bson:"frequency"`
	Traffic    []*Traffic    `bson:"sites"`
}

func (TrafficSeriesSnapshot) Save

func (h TrafficSeriesSnapshot) Save(session *mgo.Session)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL