Documentation
¶
Index ¶
Constants ¶
View Source
const FormatDatabaseName = "%sGameData" //Example NHLGameData or NBAGameData
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collection ¶
type Database ¶
type Database interface {
Collection(collection string) Collection
}
type MongoClient ¶
func (*MongoClient) Database ¶
func (m *MongoClient) Database(databaseName string) Database
Collection returns an instance of Database with provided name databaseName
func (*MongoClient) Initialize ¶
func (m *MongoClient) Initialize(address string)
Initialize initializes the mongo client at the provided address. Uses background context
type MongoCollection ¶
type MongoCollection struct {
*mongo.Collection
}
func (*MongoCollection) InsertGameSnapshot ¶
func (c *MongoCollection) InsertGameSnapshot(ctx context.Context, snapshot interface{})
InsertGameSnapshot inserts a snapshot into the collection
type MongoCursor ¶
func (*MongoCursor) Close ¶
func (c *MongoCursor) Close()
func (*MongoCursor) Decode ¶
func (c *MongoCursor) Decode() bson.Raw
func (*MongoCursor) Next ¶
func (c *MongoCursor) Next() bool
type MongoDatabase ¶
func (*MongoDatabase) Collection ¶
func (m *MongoDatabase) Collection(collectionName string) Collection
Collection returns an instance of Collection with provided name collectionName
type Server ¶
type Server struct { Client client // TODO convert this to a interface? // contains filtered or unexported fields }
func CreateDatabaseServer ¶
func CreateDatabaseServer(client client) *Server
func (*Server) GetDatabase ¶
Retrieve the database corresponding to a sport
func (*Server) GetDatabaseTickChannel ¶
Creates a new tick channel that replicates the database tick channel
func (*Server) WatchCollection ¶
func (d *Server) WatchCollection(collection Collection) <-chan bson.Raw
Returns a channel for that watches a collection for new documents
Click to show internal directories.
Click to hide internal directories.