operations

package
v1.22.1 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompleteTopicNames added in v1.10.0

func CompleteTopicNames(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective)

func CreateClient

func CreateClient(context *ClientContext) (sarama.Client, error)

func CreateClientConfig

func CreateClientConfig(context *ClientContext) (*sarama.Config, error)

func CreateClusterAdmin

func CreateClusterAdmin(context *ClientContext) (sarama.ClusterAdmin, error)

func TopicExists

func TopicExists(client *sarama.Client, name string) (bool, error)

Types

type AlterTopicFlags

type AlterTopicFlags struct {
	Partitions        int32
	ReplicationFactor int16
	ValidateOnly      bool
	Configs           []string
}

type Broker added in v1.21.0

type Broker struct {
	Id      int32
	Address string
}

type BrokerOperation added in v1.21.0

type BrokerOperation struct {
}

func (*BrokerOperation) GetBrokers added in v1.21.0

func (operation *BrokerOperation) GetBrokers(flags GetBrokersFlags) error

type ClientContext

type ClientContext struct {
	Name               string
	Brokers            []string
	Tls                TlsConfig
	Sasl               SaslConfig
	Kubernetes         K8sConfig
	RequestTimeout     time.Duration
	ClientID           string
	KafkaVersion       sarama.KafkaVersion
	AvroSchemaRegistry string
	DefaultPartitioner string
	RequiredAcks       string
}

func CreateClientContext

func CreateClientContext() (ClientContext, error)

type Config added in v1.14.0

type Config struct {
	Name  string
	Value string
}

type CreateTopicFlags

type CreateTopicFlags struct {
	Partitions        int32
	ReplicationFactor int16
	ValidateOnly      bool
	Configs           []string
}

type DescribeTopicFlags

type DescribeTopicFlags struct {
	PrintConfigs        bool
	SkipEmptyPartitions bool
	OutputFormat        string
}

type DocsFlags

type DocsFlags struct {
	Directory  string
	DocType    string
	SinglePage bool
}

type DocsOperation

type DocsOperation struct {
}

func (*DocsOperation) GenerateDocs

func (operation *DocsOperation) GenerateDocs(rootCmd *cobra.Command, flags DocsFlags) error

type GetBrokersFlags added in v1.21.0

type GetBrokersFlags struct {
	OutputFormat string
}

type GetTopicsFlags

type GetTopicsFlags struct {
	OutputFormat string
}

type K8sConfig added in v1.11.0

type K8sConfig struct {
	Enabled     bool
	Binary      string
	KubeConfig  string
	KubeContext string
	Namespace   string
}

type Partition added in v1.14.0

type Partition struct {
	Id           int32
	OldestOffset int64   `json:"oldestOffset" yaml:"oldestOffset"`
	NewestOffset int64   `json:"newestOffset" yaml:"newestOffset"`
	Leader       string  `json:",omitempty" yaml:",omitempty"`
	Replicas     []int32 `json:",omitempty" yaml:",omitempty,flow"`
	ISRs         []int32 `json:"inSyncReplicas,omitempty" yaml:"inSyncReplicas,omitempty,flow"`
}

type SaslConfig

type SaslConfig struct {
	Enabled   bool
	Username  string
	Password  string
	Mechanism string
}

type TlsConfig

type TlsConfig struct {
	Enabled  bool
	CA       string
	Cert     string
	CertKey  string
	Insecure bool
}

type Topic added in v1.14.0

type Topic struct {
	Name       string
	Partitions []Partition `json:",omitempty" yaml:",omitempty"`
	Configs    []Config    `json:",omitempty" yaml:",omitempty"`
}

func TopicFromYaml added in v1.14.0

func TopicFromYaml(yamlString string) (Topic, error)

type TopicOperation

type TopicOperation struct {
}

func (*TopicOperation) AlterTopic

func (operation *TopicOperation) AlterTopic(topic string, flags AlterTopicFlags) error

func (*TopicOperation) CreateTopics

func (operation *TopicOperation) CreateTopics(topics []string, flags CreateTopicFlags) error

func (*TopicOperation) DeleteTopics

func (operation *TopicOperation) DeleteTopics(topics []string) error

func (*TopicOperation) DescribeTopic

func (operation *TopicOperation) DescribeTopic(topic string, flags DescribeTopicFlags) error

func (*TopicOperation) GetTopics

func (operation *TopicOperation) GetTopics(flags GetTopicsFlags) error

func (*TopicOperation) ListTopicsNames added in v1.10.0

func (operation *TopicOperation) ListTopicsNames() ([]string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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