store

package
v5.2.5+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2018 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DatabaseName is DatabaseName on mongoBD
	DatabaseName = "tat"

	// CollectionDefaultMessages is default names for collections message, if
	// topic doesn't have "collection" attribute setted
	CollectionDefaultMessages = "messages"
)

Variables

This section is empty.

Functions

func DBReplSetGetConfig

func DBReplSetGetConfig() (bson.M, error)

DBReplSetGetConfig returns replSetGetConfig cmd

func DBReplSetGetStatus

func DBReplSetGetStatus() (bson.M, error)

DBReplSetGetStatus returns replSetGetStatus cmd

func DBServerStatus

func DBServerStatus() (bson.M, error)

DBServerStatus returns serverStatus cmd

func DBStats

func DBStats() (bson.M, error)

DBStats returns dbstats cmd

func DBStatsCollection

func DBStatsCollection(colName string) (bson.M, error)

DBStatsCollection returns stats for given collection

func EnsureIndexes

func EnsureIndexes()

EnsureIndexes fixes index at startup

func EnsureIndexesMessages

func EnsureIndexesMessages(collection string)

EnsureIndexesMessages set indexes on a message collection

func GetCMessages

func GetCMessages(collection string) *mgo.Collection

GetCMessages return mgo collection

func GetCollectionNames

func GetCollectionNames() ([]string, error)

GetCollectionNames returns collection names

func GetSlowestQueries

func GetSlowestQueries() ([]map[string]interface{}, error)

GetSlowestQueries returns the slowest queries

func NewStore

func NewStore() error

NewStore initializes a new MongoDB Store

func RefreshStore

func RefreshStore()

RefreshStore calls Refresh on mongoDB Store, in order to avoid lost connection

Types

type MongoStore

type MongoStore struct {
	Session          *mgo.Session
	CGroups          *mgo.Collection
	CDefaultMessages *mgo.Collection
	CPresences       *mgo.Collection
	CTopics          *mgo.Collection
	CUsers           *mgo.Collection
	CSockets         *mgo.Collection
}

MongoStore stores MongoDB Session and collections

func Tat

func Tat() *MongoStore

Tat returns mongoDB instance for Tat

Jump to

Keyboard shortcuts

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