Documentation
¶
Overview ¶
Package msgstore provides functionality for storing and retrieving messages (events) to/from a database.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type RC ¶
type RC byte
func LogMessage ¶
func LogMessage(ctx *b.Context, msg *b.Message, timestamp *b.Timestamp, recordIdentical bool) (RC, m.Changes)
LogMessage records a message in the database. It first checks if a message with the same key as the supplied (new) one is already present in the database. If this is not the case the new message is stored and the info `RC_new` is returned. Otherwise the payload of the new message is compared to the present one's payload; if they are different, a record with the new message is inserted and the info `RC_changed` is returned, together with a mapping of the existing fields that have changed. If there is an already identical message in the database, the info `RC_no_change` is returned; if the parameter `recordIdentical` is set to true an addition record with the message (with updated timestamp) is inserted.