topic

package
v5.2.5+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2018 License: BSD-3-Clause Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAdminGroup

func AddAdminGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error

AddAdminGroup add a admin group to topic

func AddAdminUser

func AddAdminUser(topic *tat.Topic, admin string, username string, recursive bool) error

AddAdminUser add a read write user to topic

func AddFilter

func AddFilter(topic *tat.Topic, user *tat.User, filter *tat.Filter) error

AddFilter add a user filter to the 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

func AddRoGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error

AddRoGroup add a read only group to topic

func AddRoUser

func AddRoUser(topic *tat.Topic, admin string, username string, recursive bool) error

AddRoUser add a read only user to topic

func AddRwGroup

func AddRwGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error

AddRwGroup add a read write group to topic

func AddRwUser

func AddRwUser(topic *tat.Topic, admin string, username string, recursive bool) error

AddRwUser add a read write user to topic

func AllTopicsComputeLabels

func AllTopicsComputeLabels() (string, error)

AllTopicsComputeLabels computes Labels on all topics

func AllTopicsComputeTags

func AllTopicsComputeTags() (string, error)

AllTopicsComputeTags computes Tags on all topics

func AllTopicsSetParam

func AllTopicsSetParam(key, value string) (string, error)

AllTopicsSetParam computes Tags on all topics

func ChangeGroupnameOnTopics

func ChangeGroupnameOnTopics(oldGroupname, newGroupname string) error

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

func CheckAndFixName(topic *tat.Topic) error

CheckAndFixName Add a / to topic name is it is not present return an error if length of name is < 4 or > 100

func ComputeLabels

func ComputeLabels(topic *tat.Topic) (int, error)

ComputeLabels computes "cached" labels on a topic initialize labels, one entry per label (unicity with text & color)

func ComputeTags

func ComputeTags(topic *tat.Topic) (int, error)

ComputeTags computes "cached" tags in topic initialize tags, one entry per tag (unique)

func CountTopics

func CountTopics() (int, error)

CountTopics returns the total number of topics in db

func Delete

func Delete(topic *tat.Topic, u *tat.User) error

Delete deletes a topic from database

func FindAllTopicsWithCollections

func FindAllTopicsWithCollections() ([]tat.Topic, error)

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

func GetTopicSelectedFields(isAdmin, withTags, withLabels, oneTopic bool) bson.M

GetTopicSelectedFields return allowed selected field on mongo

func GetUserRights

func GetUserRights(topic *tat.Topic, user *tat.User) (bool, bool)

GetUserRights return isRW, isAdmin for user Check personal access to topic, and group access

func InitDB

func InitDB()

InitDB creates /Private topic if necessary

func InitPrivateTopic

func InitPrivateTopic()

InitPrivateTopic insert topic "/Private"

func Insert

func Insert(topic *tat.Topic, u *tat.User) error

Insert creates a new topic. User is read write on topic

func IsTopicExists

func IsTopicExists(topicName string) bool

IsTopicExists return true if topic exists, false otherwise

func IsUserAdmin

func IsUserAdmin(topic *tat.Topic, user *tat.User) bool

IsUserAdmin return true if user is Tat admin or is admin on this topic Check personal access to topic, and group access

func ListLabels

func ListLabels(topic tat.Topic) ([]tat.Label, error)

ListLabels returns all labels on one topic

func ListTags

func ListTags(topic tat.Topic) ([]string, error)

ListTags returns all tags 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

func MigrateToDedicatedTopic(topic *tat.Topic) error

MigrateToDedicatedTopic sets collection attribute on topic

func RemoveAdminGroup

func RemoveAdminGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error

RemoveAdminGroup removes a read write group from topic

func RemoveAdminUser

func RemoveAdminUser(topic *tat.Topic, admin string, username string, recursive bool) error

RemoveAdminUser removes a read only user from topic

func RemoveFilter

func RemoveFilter(topic *tat.Topic, filter *tat.Filter) error

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

func RemoveRoGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error

RemoveRoGroup removes a read only group from topic

func RemoveRoUser

func RemoveRoUser(topic *tat.Topic, admin string, username string, recursive bool) error

RemoveRoUser removes a read only user from topic

func RemoveRwGroup

func RemoveRwGroup(topic *tat.Topic, admin string, groupname string, recursive bool) error

RemoveRwGroup removes a read write group from topic

func RemoveRwUser

func RemoveRwUser(topic *tat.Topic, admin string, username string, recursive bool) error

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 Truncate

func Truncate(topic *tat.Topic) (int, error)

Truncate removes all messages in a topic

func TruncateLabels

func TruncateLabels(topic *tat.Topic) error

TruncateLabels clears "cached" labels on a topic

func TruncateTags

func TruncateTags(topic *tat.Topic) error

TruncateTags clears "cached" tags in topic

func UpdateFilter

func UpdateFilter(topic *tat.Topic, filter *tat.Filter) error

UpdateFilter add a user filter to the topic

func UpdateTopicLabels

func UpdateTopicLabels(topic *tat.Topic, labels []tat.Label)

UpdateTopicLabels updates labels on topic

func UpdateTopicLastMessage

func UpdateTopicLastMessage(topic *tat.Topic, dateUpdateLastMsg time.Time)

UpdateTopicLastMessage updates tags on topic

func UpdateTopicTags

func UpdateTopicTags(topic *tat.Topic, tags []string)

UpdateTopicTags updates tags on topic

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL