Ejemplo n.º 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()
}
Ejemplo n.º 2
0
func RetrieveChatList(owner string) {
	session := core.NewCassandraRConn()
	session.Query(retrieveChatLists, owner).Bind()
}
Ejemplo n.º 3
0
func RetrieveChatListByType(owner string, chatType int) {
	session := core.NewCassandraRConn()
	session.Query(retrieveChatListByType, owner, chatType).Attempts()
}