database

package
v0.0.0-...-089c6f0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2016 License: MIT Imports: 2 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Game

type Game struct {
	ID              int    `json:"appid" bson:"steam_id"`
	Name            string `json:"name" bson:"name"`
	PlaytimeForever int    `json:"playtime_forever" bson:"playtimeForever"`
	PlaytimeRecent  int    `json:"playtime_2weeks" bson:"playtimeRecent"`
}

type Interface

type Interface interface {
	SetSession(*mgo.Session)
	GetSession() *mgo.Session
	GetInt(string, int) (map[string]interface{}, error)
	UpsertIntField(string, int, interface{}) error
	GetAllGamesWithoutURL() ([]Game, error)
}

type MongoDB

type MongoDB struct {
	Collection *mgo.Collection
	// contains filtered or unexported fields
}

func (*MongoDB) GetAllGamesWithoutURL

func (mongoDB *MongoDB) GetAllGamesWithoutURL() (results []Game, err error)

func (*MongoDB) GetInt

func (mongoDB *MongoDB) GetInt(field string, searchValue int) (result map[string]interface{}, err error)

func (*MongoDB) GetSession

func (mongoDB *MongoDB) GetSession() *mgo.Session

func (*MongoDB) SetSession

func (mongoDB *MongoDB) SetSession(session *mgo.Session)

func (*MongoDB) UpsertIntField

func (mongoDB *MongoDB) UpsertIntField(field string, searchValue int, record interface{}) error

Jump to

Keyboard shortcuts

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