示例#1
0
文件: message.go 项目: cs6402/goose
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()
}
示例#2
0
文件: message.go 项目: cs6402/goose
func RetrieveChatList(owner string) {
	session := core.NewCassandraRConn()
	session.Query(retrieveChatLists, owner).Bind()
}
示例#3
0
文件: message.go 项目: cs6402/goose
func RetrieveChatListByType(owner string, chatType int) {
	session := core.NewCassandraRConn()
	session.Query(retrieveChatListByType, owner, chatType).Attempts()
}