data

package
v0.0.0-...-3322d40 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2015 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RandomKey

func RandomKey(a []*datastore.Key) *datastore.Key

Types

type ByFollowers

type ByFollowers []UserRecord

func (ByFollowers) Len

func (a ByFollowers) Len() int

func (ByFollowers) Less

func (a ByFollowers) Less(i, j int) bool

func (ByFollowers) Swap

func (a ByFollowers) Swap(i, j int)

type ByLoops

type ByLoops []UserRecord

func (ByLoops) Len

func (a ByLoops) Len() int

func (ByLoops) Less

func (a ByLoops) Less(i, j int) bool

func (ByLoops) Swap

func (a ByLoops) Swap(i, j int)

type ByOverall

type ByOverall []UserRecord

func (ByOverall) Len

func (a ByOverall) Len() int

func (ByOverall) Less

func (a ByOverall) Less(i, j int) bool

func (ByOverall) Swap

func (a ByOverall) Swap(i, j int)

type ByPosts

type ByPosts []UserRecord

func (ByPosts) Len

func (a ByPosts) Len() int

func (ByPosts) Less

func (a ByPosts) Less(i, j int) bool

func (ByPosts) Swap

func (a ByPosts) Swap(i, j int)

type ByRevines

type ByRevines []UserRecord

func (ByRevines) Len

func (a ByRevines) Len() int

func (ByRevines) Less

func (a ByRevines) Less(i, j int) bool

func (ByRevines) Swap

func (a ByRevines) Swap(i, j int)

type DB

type DB struct {
	Context context.Context
}

func NewRequest

func NewRequest(c context.Context) *DB

func (*DB) ExportUser

func (db *DB) ExportUser(userIdStr string, w http.ResponseWriter)

func (*DB) FetchUser

func (db *DB) FetchUser(userId string) error

func (*DB) GenSummaryChart

func (db *DB) GenSummaryChart(user *UserRecord) (string, error)

func (*DB) GetQueuedUser

func (db *DB) GetQueuedUser(userId string) (user *QueuedUser, err error)

func (*DB) GetRecentUsers

func (db *DB) GetRecentUsers(n int, filter ...interface{}) (records []UserRecord, err error)

func (*DB) GetTop

func (db *DB) GetTop() (data map[string]interface{})

func (*DB) GetTotalUsers

func (db *DB) GetTotalUsers() (int, error)

func (*DB) GetUser

func (db *DB) GetUser(userId int64) (user *UserRecord, err error)

func (*DB) GetUserData

func (db *DB) GetUserData(userId int64) (userData []*UserData, err error)

func (*DB) GetUserMeta

func (db *DB) GetUserMeta(userId int64) (userMeta []*UserMeta, err error)

func (*DB) GetUserRecord

func (db *DB) GetUserRecord(userId int64) (*UserRecord, error)

func (*DB) QueueUser

func (db *DB) QueueUser(userId string)

func (*DB) SearchUsers

func (db *DB) SearchUsers(query string) ([]UserRecord, error)

func (*DB) UnqueueUser

func (db *DB) UnqueueUser(user string)

func (*DB) UserQueueExist

func (db *DB) UserQueueExist(userId int64) bool

type MetaStats

type MetaStats struct {
	Count     int       `datastore:"count"`
	Timestamp time.Time `datastore:"timestamp"`
}

type QueuedUser

type QueuedUser struct {
	UserID     string
	Discovered time.Time
}

type UserData

type UserData struct {
	UserId    int64
	Recorded  time.Time
	Followers int64
	Following int64
	Loops     int64
	Velocity  float64
	Posts     int64
	Revines   int64
	Likes     int64
}

type UserIndex

type UserIndex struct {
	Username, Location, Description, VanityUrl string
}

type UserMeta

type UserMeta struct {
	UserId  int64
	Record  string
	Value   string `datastore:",noindex"`
	Updated time.Time
}

type UserRecord

type UserRecord struct {
	UserId            string
	Discovered        time.Time
	Username          string `datastore:",noindex"`
	Vanity            string
	Description       string `datastore:",noindex"`
	Location          string `datastore:",noindex"`
	ProfileBackground string `datastore:",noindex"`
	AvatarUrl         string `datastore:",noindex"`
	FollowerCount     int64
	FollowingCount    int64
	LoopCount         int64
	LoopVelocity      float64
	PostCount         int64
	RevineCount       int64
	LikeCount         int64
	Private           bool
	Verified          bool
	Explicit          bool
	UserData          []*UserData `datastore:"-"`
	UserMeta          []*UserMeta `datastore:"-"`
	UserDataJsonStr   string      `datastore:"-"`
	UserMetaJsonStr   string      `datastore:"-"`
}

Jump to

Keyboard shortcuts

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