Documentation ¶
Overview ¶
Package events is responsible for saving events.
Index ¶
- Constants
- func AnonymiseUserEvents(user string) (int64, error)
- func DeleteEvent(ID string) error
- func DeleteTopicEvents(topicid string) (int64, error)
- func DeleteTopicEventsBefore(topicid string, t time.Time) (int64, error)
- func InitDB(config string) error
- func SaveEvent(e Event) (string, error)
- func SaveEvents(e []Event) error
- type Event
Constants ¶
const AnoymousUser = "SYSTEM: DELETED USER"
Variables ¶
This section is empty.
Functions ¶
func AnonymiseUserEvents ¶
AnonymiseUserEvents removes the user name from all events associated by a user. It returns the number of renamed events.
func DeleteTopicEvents ¶
DeleteTopicEvents removes all events associated by a topic. It returns the number of deleted events.
func DeleteTopicEventsBefore ¶
DeleteTopicEventsBefore removes all events of a topic before a certain time. It returns the number of deleted events.
func InitDB ¶
InitDB initialises the database. Must be called before any other function. This stub will return an error if no build tags are set.
func SaveEvents ¶
SaveEvent saves multiple events. The method is optimised for insering multiple objects. ID will be ignored.
Types ¶
type Event ¶
type Event struct { ID string Type int User string Topic string Date time.Time Data []byte `xml:",cdata"` AffectedUser string }
Event represents a file.
func GetEventsOfTopic ¶
GetEventsOfTopic returns all events associated by a topic.
func GetEventsOfUser ¶
GetEventsOfUser returns all events associated by a user.