Beispiel #1
0
func GetMessages(receiver string, sender string, last string, limit int) ([]*MessageWithId, error) {
	session := core.NewCassandraRConn()
	iter := session.Query(retrieveMessages,
		receiver, sender, last, limit).Iter()
	result := make([]*MessageWithId, iter.NumRows())
	var id string
	var payload string
	index := 0
	for iter.Scan(&id, &payload) {
		result[index] = &MessageWithId{id, payload}
		index++
		log.Println(id, payload)
	}

	return result, iter.Close()
}
Beispiel #2
0
func RetrieveChatList(owner string) {
	session := core.NewCassandraRConn()
	session.Query(retrieveChatLists, owner).Bind()
}
Beispiel #3
0
func RetrieveChatListByType(owner string, chatType int) {
	session := core.NewCassandraRConn()
	session.Query(retrieveChatListByType, owner, chatType).Attempts()
}