Added comments to exported functions

Signed-off-by: Alexey Terentyev <axifnx@gmail.com>
This commit is contained in:
Alexey Terentyev 2018-06-16 16:44:08 +03:00
parent b0e7d001f8
commit 6579ddf9d8
No known key found for this signature in database
GPG Key ID: 60D6C550AEEBB467

View File

@ -54,11 +54,12 @@ func (err ErrTopicNotExist) Error() string {
return fmt.Sprintf("topic is not exist [name: %s]", err.Name)
}
// TopicValidator checks topics by length and match pattern rules
func TopicValidator(topic string) bool {
return len(topic) <= 35 && topicPattern.MatchString(topic)
}
// Remove duplicates from topics slice
// RemoveDuplicateTopics remove duplicates from topics slice
func RemoveDuplicateTopics(topics []string) []string {
// Map to record duplicates
saved := make(map[string]struct{}, len(topics))