aboutsummaryrefslogtreecommitdiff
path: root/weed/mq/topic/topic.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-10-02 01:01:45 -0700
committerchrislu <chris.lu@gmail.com>2023-10-02 01:01:45 -0700
commit734178093e1e5d86dd6bd81ac3abe9b9f814ea36 (patch)
treeae88c489924fb3ff0ef41660b2ac95a5e2facab3 /weed/mq/topic/topic.go
parent2a578b9033b2de12aeb49ae88a694d2510085665 (diff)
downloadseaweedfs-734178093e1e5d86dd6bd81ac3abe9b9f814ea36.tar.xz
seaweedfs-734178093e1e5d86dd6bd81ac3abe9b9f814ea36.zip
refactor TopicPartition struct
Diffstat (limited to 'weed/mq/topic/topic.go')
-rw-r--r--weed/mq/topic/topic.go10
1 files changed, 4 insertions, 6 deletions
diff --git a/weed/mq/topic/topic.go b/weed/mq/topic/topic.go
index 430999179..3d457e6f1 100644
--- a/weed/mq/topic/topic.go
+++ b/weed/mq/topic/topic.go
@@ -7,14 +7,12 @@ import (
"time"
)
-type Namespace string
-
type Topic struct {
- Namespace Namespace
+ Namespace string
Name string
}
-func NewTopic(namespace Namespace, name string) Topic {
+func NewTopic(namespace string, name string) Topic {
return Topic{
Namespace: namespace,
Name: name,
@@ -22,7 +20,7 @@ func NewTopic(namespace Namespace, name string) Topic {
}
func FromPbTopic(topic *mq_pb.Topic) Topic {
return Topic{
- Namespace: Namespace(topic.Namespace),
+ Namespace: topic.Namespace,
Name: topic.Name,
}
}
@@ -41,7 +39,7 @@ type Segment struct {
func FromPbSegment(segment *mq_pb.Segment) *Segment {
return &Segment{
Topic: Topic{
- Namespace: Namespace(segment.Namespace),
+ Namespace: segment.Namespace,
Name: segment.Topic,
},
Id: segment.Id,