Documentation ¶
Index ¶
- func AddAdminGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error
- func AddAdminUser(topic *tat.Topic, admin string, username string, recursive bool) error
- func AddFilter(topic *tat.Topic, user *tat.User, filter *tat.Filter) error
- func AddParameter(topic *tat.Topic, admin string, parameterKey string, parameterValue string, ...) error
- func AddRoGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error
- func AddRoUser(topic *tat.Topic, admin string, username string, recursive bool) error
- func AddRwGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error
- func AddRwUser(topic *tat.Topic, admin string, username string, recursive bool) error
- func AllTopicsComputeLabels() (string, error)
- func AllTopicsComputeTags() (string, error)
- func AllTopicsSetParam(key, value string) (string, error)
- func ChangeGroupnameOnTopics(oldGroupname, newGroupname string) error
- func ChangeUsernameOnTopics(oldUsername, newUsername string)
- func CheckAndFixName(topic *tat.Topic) error
- func ComputeLabels(topic *tat.Topic) (int, error)
- func ComputeTags(topic *tat.Topic) (int, error)
- func CountTopics() (int, error)
- func Delete(topic *tat.Topic, u *tat.User) error
- func FindAllTopicsWithCollections() ([]tat.Topic, error)
- func FindByTopic(topicIn string, isAdmin, withTags, withLabels bool, user *tat.User) (*tat.Topic, error)
- func GetTopicSelectedFields(isAdmin, withTags, withLabels, oneTopic bool) bson.M
- func GetUserRights(topic *tat.Topic, user *tat.User) (bool, bool)
- func InitDB()
- func InitPrivateTopic()
- func Insert(topic *tat.Topic, u *tat.User) error
- func IsTopicExists(topicName string) bool
- func IsUserAdmin(topic *tat.Topic, user *tat.User) bool
- func ListLabels(topic tat.Topic) ([]tat.Label, error)
- func ListTags(topic tat.Topic) ([]string, error)
- func ListTopics(criteria *tat.TopicCriteria, u *tat.User, isAdmin, withTags, withLabels bool) (int, []tat.Topic, error)
- func MigrateToDedicatedTopic(topic *tat.Topic) error
- func RemoveAdminGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error
- func RemoveAdminUser(topic *tat.Topic, admin string, username string, recursive bool) error
- func RemoveFilter(topic *tat.Topic, filter *tat.Filter) error
- func RemoveParameter(topic *tat.Topic, admin string, parameterKey string, parameterValue string, ...) error
- func RemoveRoGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error
- func RemoveRoUser(topic *tat.Topic, admin string, username string, recursive bool) error
- func RemoveRwGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error
- func RemoveRwUser(topic *tat.Topic, admin string, username string, recursive bool) error
- func SetParam(topic *tat.Topic, username string, recursive bool, maxLength, maxReplies int, ...) error
- func Truncate(topic *tat.Topic) (int, error)
- func TruncateLabels(topic *tat.Topic) error
- func TruncateTags(topic *tat.Topic) error
- func UpdateFilter(topic *tat.Topic, filter *tat.Filter) error
- func UpdateTopicLabels(topic *tat.Topic, labels []tat.Label)
- func UpdateTopicLastMessage(topic *tat.Topic, dateUpdateLastMsg time.Time)
- func UpdateTopicTags(topic *tat.Topic, tags []string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAdminGroup ¶
AddAdminGroup add a admin group to topic
func AddAdminUser ¶
AddAdminUser add a read write user to topic
func AddParameter ¶
func AddParameter(topic *tat.Topic, admin string, parameterKey string, parameterValue string, recursive bool) error
AddParameter add a parameter to the topic
func AddRoGroup ¶
AddRoGroup add a read only group to topic
func AddRwGroup ¶
AddRwGroup add a read write group to topic
func AllTopicsComputeLabels ¶
AllTopicsComputeLabels computes Labels on all topics
func AllTopicsComputeTags ¶
AllTopicsComputeTags computes Tags on all topics
func AllTopicsSetParam ¶
AllTopicsSetParam computes Tags on all topics
func ChangeGroupnameOnTopics ¶
ChangeGroupnameOnTopics updates group name on topics
func ChangeUsernameOnTopics ¶
func ChangeUsernameOnTopics(oldUsername, newUsername string)
ChangeUsernameOnTopics changes a username on topics, ro, rw, admin users
func CheckAndFixName ¶
CheckAndFixName Add a / to topic name is it is not present return an error if length of name is < 4 or > 100
func ComputeLabels ¶
ComputeLabels computes "cached" labels on a topic initialize labels, one entry per label (unicity with text & color)
func ComputeTags ¶
ComputeTags computes "cached" tags in topic initialize tags, one entry per tag (unique)
func CountTopics ¶
CountTopics returns the total number of topics in db
func FindAllTopicsWithCollections ¶
FindAllTopicsWithCollections returns the total number of topics in db
func FindByTopic ¶
func FindByTopic(topicIn string, isAdmin, withTags, withLabels bool, user *tat.User) (*tat.Topic, error)
FindByTopic returns topic by topicName.
func GetTopicSelectedFields ¶
GetTopicSelectedFields return allowed selected field on mongo
func GetUserRights ¶
GetUserRights return isRW, isAdmin for user Check personal access to topic, and group access
func IsTopicExists ¶
IsTopicExists return true if topic exists, false otherwise
func IsUserAdmin ¶
IsUserAdmin return true if user is Tat admin or is admin on this topic Check personal access to topic, and group access
func ListLabels ¶
ListLabels returns all labels on one topic
func ListTopics ¶
func ListTopics(criteria *tat.TopicCriteria, u *tat.User, isAdmin, withTags, withLabels bool) (int, []tat.Topic, error)
ListTopics returns list of topics, matching criterias /!\ user arg could be nil
func MigrateToDedicatedTopic ¶
MigrateToDedicatedTopic sets collection attribute on topic
func RemoveAdminGroup ¶
RemoveAdminGroup removes a read write group from topic
func RemoveAdminUser ¶
RemoveAdminUser removes a read only user from topic
func RemoveFilter ¶
RemoveFilter add a user filter to the topic
func RemoveParameter ¶
func RemoveParameter(topic *tat.Topic, admin string, parameterKey string, parameterValue string, recursive bool) error
RemoveParameter removes a read only user from topic
func RemoveRoGroup ¶
RemoveRoGroup removes a read only group from topic
func RemoveRoUser ¶
RemoveRoUser removes a read only user from topic
func RemoveRwGroup ¶
RemoveRwGroup removes a read write group from topic
func RemoveRwUser ¶
RemoveRwUser removes a read write user from topic
func SetParam ¶
func SetParam(topic *tat.Topic, username string, recursive bool, maxLength, maxReplies int, canForceDate, canUpdateMsg, canDeleteMsg, canUpdateAllMsg, canDeleteAllMsg, adminCanUpdateAllMsg, adminCanDeleteAllMsg, isAutoComputeTags, isAutoComputeLabels bool, parameters []tat.TopicParameter) error
SetParam update param maxLength, maxReplies, canForceDate, canUpdateMsg, canDeleteMsg, canUpdateAllMsg, canDeleteAllMsg, adminCanUpdateAllMsg, adminCanDeleteAllMsg, parameters on topic
func TruncateLabels ¶
TruncateLabels clears "cached" labels on a topic
func TruncateTags ¶
TruncateTags clears "cached" tags in topic
func UpdateFilter ¶
UpdateFilter add a user filter to the topic
func UpdateTopicLabels ¶
UpdateTopicLabels updates labels on topic
func UpdateTopicLastMessage ¶
UpdateTopicLastMessage updates tags on topic
func UpdateTopicTags ¶
UpdateTopicTags updates tags on topic
Types ¶
This section is empty.