-
Notifications
You must be signed in to change notification settings - Fork 72
/
topic.go
40 lines (35 loc) · 1.33 KB
/
topic.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package topic
import (
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/topic/consume"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/topic/create"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/topic/delete"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/topic/describe"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/topic/list"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/topic/produce"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/topic/update"
"github.com/redhat-developer/app-services-cli/pkg/shared/factory"
"github.com/spf13/cobra"
)
const (
Name = "name"
Operation = "operation"
)
// NewTopicCommand gives commands that manages Kafka topics.
func NewTopicCommand(f *factory.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "topic",
Short: f.Localizer.MustLocalize("kafka.topic.cmd.shortDescription"),
Long: f.Localizer.MustLocalize("kafka.topic.cmd.longDescription"),
Example: f.Localizer.MustLocalize("kafka.topic.cmd.example"),
}
cmd.AddCommand(
create.NewCreateTopicCommand(f),
list.NewListTopicCommand(f),
delete.NewDeleteTopicCommand(f),
describe.NewDescribeTopicCommand(f),
update.NewUpdateTopicCommand(f),
produce.NewProduceTopicCommand(f),
consume.NewConsumeTopicCommand(f),
)
return cmd
}