-
Notifications
You must be signed in to change notification settings - Fork 72
/
kafka.go
44 lines (40 loc) · 1.68 KB
/
kafka.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
41
42
43
44
// Package kafka instance contains commands for interacting with cluster logic of the service directly instead of through the
// REST API exposed via the serve command.
package kafka
import (
"github.com/redhat-developer/app-services-cli/internal/doc"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/acl"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/consumergroup"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/create"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/delete"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/describe"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/list"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/topic"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/update"
"github.com/redhat-developer/app-services-cli/pkg/cmd/kafka/use"
"github.com/redhat-developer/app-services-cli/pkg/shared/factory"
"github.com/spf13/cobra"
)
func NewKafkaCommand(f *factory.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "kafka",
Annotations: map[string]string{doc.AnnotationName: "Kafka commands"},
Short: f.Localizer.MustLocalize("kafka.cmd.shortDescription"),
Long: f.Localizer.MustLocalize("kafka.cmd.longDescription"),
Example: f.Localizer.MustLocalize("kafka.cmd.example"),
Args: cobra.MinimumNArgs(1),
}
// add sub-commands
cmd.AddCommand(
create.NewCreateCommand(f),
describe.NewDescribeCommand(f),
delete.NewDeleteCommand(f),
list.NewListCommand(f),
use.NewUseCommand(f),
topic.NewTopicCommand(f),
consumergroup.NewConsumerGroupCommand(f),
update.NewUpdateCommand(f),
acl.NewAclCommand(f),
)
return cmd
}