Documentation ¶
Index ¶
- func Bytes(dbname, collname string, spec bson.M) int
- func Count(dbname, collname string, spec bson.M) int
- func CreateIndexes(dbname, collname string, keys []string)
- func GetBytesFromDASRecord(data DASRecord) ([]byte, error)
- func GetInt64Value(rec DASRecord, key string) (int64, error)
- func GetIntValue(rec DASRecord, key string) (int, error)
- func GetSingleStringValue(rec DASRecord, key string) (string, error)
- func GetStringValue(rec DASRecord, key string) (string, error)
- func GetValue(rec DASRecord, key string) interface{}
- func Insert(dbname, collname string, records []DASRecord)
- func Remove(dbname, collname string, spec bson.M)
- func Update(dbname, collname string, spec, newdata bson.M)
- type DASRecord
- func Convert2DASRecord(item interface{}) DASRecord
- func DASErrorRecord(msg, etype string, ecode int) DASRecord
- func Get(dbname, collname string, spec bson.M, idx, limit int) []DASRecord
- func GetFilteredSorted(dbname, collname string, spec bson.M, fields, skeys []string, idx, limit int) []DASRecord
- func GetSorted(dbname, collname string, spec bson.M, skeys []string) []DASRecord
- func LoadJsonData(data []byte) DASRecord
- type MongoConnection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateIndexes ¶
CreateIndexes creates DAS cache indexes
func GetBytesFromDASRecord ¶
GetBytesFromDASRecord converts DASRecord map into bytes
func GetInt64Value ¶
GetInt64Value function to get int value from DAS record for given key
func GetIntValue ¶
GetIntValue function to get int value from DAS record for given key
func GetSingleStringValue ¶
GetSingleStringValue function to get string value from DAS record for given key
func GetStringValue ¶
GetStringValue function to get string value from DAS record for given key
Types ¶
type DASRecord ¶
type DASRecord map[string]interface{}
DASRecord define DAS record
func Convert2DASRecord ¶
func Convert2DASRecord(item interface{}) DASRecord
Convert2DASRecord converts given interface to DAS Record data type
func DASErrorRecord ¶
DASErrorRecord provides DAS error record
func GetFilteredSorted ¶
func GetFilteredSorted(dbname, collname string, spec bson.M, fields, skeys []string, idx, limit int) []DASRecord
GetFilteredSorted get records from MongoDB filtered and sorted by given key
func LoadJsonData ¶
LoadJsonData stream from series of bytes
type MongoConnection ¶
type MongoConnection struct {
Session *mgo.Session
}
MongoConnection defines connection to MongoDB
func (*MongoConnection) Connect ¶
func (m *MongoConnection) Connect() *mgo.Session
Connect provides connection to MongoDB