Documentation ¶
Index ¶
- func AddLabel(message *tat.Message, topic tat.Topic, label string, color string) (tat.Label, error)
- func AddToTasks(message *tat.Message, user tat.User, topic tat.Topic) error
- func AllTopicsComputeReplies() (string, error)
- func ChangeUsernameOnMessages(oldUsername, newUsername string) error
- func ChangeUsernameOnMessagesTopics(oldUsername, newUsername string) error
- func CheckAndFixText(message *tat.Message, topic tat.Topic) error
- func ComputeReplies(topic tat.Topic) (int, error)
- func CountAllMessages() (int, error)
- func CountMessages(criteria *tat.MessageCriteria, topic tat.Topic) (int, error)
- func CountMsgSinceDate(topic tat.Topic, date int64) (int, error)
- func Delete(message *tat.Message, cascade bool, topic tat.Topic) error
- func FindByID(message *tat.Message, id string, topic tat.Topic) error
- func FindByIDDefaultCollection(message *tat.Message, id string) error
- func FullTreeMessages(messages []tat.Message, nloop int, criteria *tat.MessageCriteria, ...) ([]tat.Message, error)
- func InitDB()
- func Insert(message *tat.Message, user tat.User, topic tat.Topic, text, inReplyOfID string, ...) error
- func Like(message *tat.Message, user tat.User, topic tat.Topic) error
- func ListMessages(criteria *tat.MessageCriteria, username string, topic tat.Topic) ([]tat.Message, error)
- func MigrateMessagesToDedicatedTopic(topic *tat.Topic, limit int) (int, error)
- func Move(message *tat.Message, user tat.User, fromTopic tat.Topic, toTopic tat.Topic) error
- func OneTreeMessages(messages []tat.Message, nloop int, criteria *tat.MessageCriteria, ...) ([]tat.Message, error)
- func RemoveAllAndAddNewLabel(message *tat.Message, labels []tat.Label, topic tat.Topic) error
- func RemoveAllAndAddNewLabelOrCreate(message *tat.Message, labels []tat.Label, topic tat.Topic) error
- func RemoveFromTasks(message *tat.Message, user tat.User, topic tat.Topic) error
- func RemoveLabel(message *tat.Message, label string, topic tat.Topic) error
- func RemoveSomeAndAddNewLabel(message *tat.Message, labelsToAdd []tat.Label, labelsToRemove []string, ...) error
- func UnVoteDown(message *tat.Message, user tat.User, topic tat.Topic) error
- func UnVoteUP(message *tat.Message, user tat.User, topic tat.Topic) error
- func Unlike(message *tat.Message, user tat.User, topic tat.Topic) error
- func Update(message *tat.Message, user tat.User, topic tat.Topic, newText string, ...) error
- func VoteDown(message *tat.Message, user tat.User, topic tat.Topic) error
- func VoteUP(message *tat.Message, user tat.User, topic tat.Topic) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddToTasks ¶
AddToTasks add a message to user's tasks tat.Topic
func AllTopicsComputeReplies ¶
AllTopicsComputeReplies computes Replies on all topics
func ChangeUsernameOnMessages ¶
ChangeUsernameOnMessages changes username of a user on all msg
func ChangeUsernameOnMessagesTopics ¶
ChangeUsernameOnMessagesTopics change username on topics
func CheckAndFixText ¶
CheckAndFixText truncates to maxLength (parameter on topic) characters if len < 1, return error
func ComputeReplies ¶
ComputeReplies re-compute replies for all messages in one topic
func CountAllMessages ¶
CountAllMessages returns the total number of messages in db
func CountMessages ¶
CountMessages list messages with given criteria
func CountMsgSinceDate ¶
CountMsgSinceDate return number of messages created on one topic from a given date
func FindByIDDefaultCollection ¶
FindByIDDefaultCollection returns message by given ID TODO remove this func after migrate all topic to dedicated
func FullTreeMessages ¶
func FullTreeMessages(messages []tat.Message, nloop int, criteria *tat.MessageCriteria, username string, topic tat.Topic) ([]tat.Message, error)
FullTreeMessages returns list msg with only full deep
func InitDB ¶
func InitDB()
InitDB gets all topics, for each topic with "collection" setted, add collection to store
func Insert ¶
func Insert(message *tat.Message, user tat.User, topic tat.Topic, text, inReplyOfID string, dateCreation float64, labels []tat.Label, replies []string, repliesJSON []tat.MessageJSON, messageRoot *tat.Message) error
Insert a new message on one topic
func ListMessages ¶
func ListMessages(criteria *tat.MessageCriteria, username string, topic tat.Topic) ([]tat.Message, error)
ListMessages list messages with given criteria
func MigrateMessagesToDedicatedTopic ¶
MigrateMessagesToDedicatedTopic migrates a topic, from default to dedicated
func OneTreeMessages ¶
func OneTreeMessages(messages []tat.Message, nloop int, criteria *tat.MessageCriteria, username string, topic tat.Topic) ([]tat.Message, error)
OneTreeMessages returns list msg with only one deep
func RemoveAllAndAddNewLabel ¶
RemoveAllAndAddNewLabel removes all labels and add new label on message
func RemoveAllAndAddNewLabelOrCreate ¶
func RemoveAllAndAddNewLabelOrCreate(message *tat.Message, labels []tat.Label, topic tat.Topic) error
RemoveAllAndAddNewLabelOrCreate removes all labels and add new label on message
func RemoveFromTasks ¶
RemoveFromTasks removes a task from user's Tasks tat.Topic
func RemoveLabel ¶
RemoveLabel removes label from on message (label text matching)
func RemoveSomeAndAddNewLabel ¶
func RemoveSomeAndAddNewLabel(message *tat.Message, labelsToAdd []tat.Label, labelsToRemove []string, topic tat.Topic) error
RemoveSomeAndAddNewLabel removes some labels and add new label on message
func UnVoteDown ¶
UnVoteDown removes a vote down from a message
func Update ¶
func Update(message *tat.Message, user tat.User, topic tat.Topic, newText string, action string) error
Update updates a message from database action could be concat (for adding additional text to message or update)
Types ¶
This section is empty.