Documentation
¶
Overview ¶
Package strimzi provides Kubernetes client bindings for Strimzi Kafka custom resources.
This package generates typed Go clients for Kafka CRDs (Custom Resource Definitions) using Kubernetes code generation tools, enabling programmatic management of Strimzi Kafka resources in your Go applications.
Example usage:
ctx := context.Background()
clientset, err := strimzi.CreateClientset(ctx, "")
if err != nil {
log.Fatal(err)
}
topics, err := clientset.KafkaV1beta2().KafkaTopics("kafka").List(ctx, metav1.ListOptions{})
if err != nil {
log.Fatal(err)
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KafkaTopicInterface ¶
type KafkaTopicInterface = v1beta2.KafkaTopicInterface
KafkaTopicInterface is a type alias for v1beta2.KafkaTopicInterface that enables mock generation using counterfeiter.
type KafkaV1beta2Interface ¶ added in v1.6.1
type KafkaV1beta2Interface v1beta2.KafkaV1beta2Interface
KafkaV1beta2Interface is a type alias for v1beta2.KafkaV1beta2Interface that enables mock generation using counterfeiter.
type StrimziClientset ¶ added in v1.5.4
StrimziClientset provides access to all Strimzi Kafka custom resource clients. It includes typed clients for KafkaTopics and other Strimzi resources.
func CreateClientset ¶
func CreateClientset(ctx context.Context, kubeconfig string) (StrimziClientset, error)
CreateClientset creates a new Strimzi clientset for interacting with Kafka custom resources.
Parameters:
- ctx: Context for the operation
- kubeconfig: Path to kubeconfig file. If empty, uses default kubeconfig resolution (in-cluster config if running in pod, or ~/.kube/config if running locally)
Returns:
- StrimziClientset: A clientset for accessing Strimzi Kafka resources
- error: Any error that occurred during clientset creation
Example:
// Use default kubeconfig clientset, err := strimzi.CreateClientset(ctx, "") // Use specific kubeconfig file clientset, err := strimzi.CreateClientset(ctx, "/path/to/kubeconfig")
type TopicDeployer ¶
type TopicDeployer interface {
// Deploy creates or updates a KafkaTopic resource in Kubernetes.
// If the topic doesn't exist, it will be created. If it exists, it will be updated
// with the new configuration while preserving the resource version.
Deploy(ctx context.Context, topic v1beta2.KafkaTopic) error
// Undeploy removes a KafkaTopic resource from Kubernetes.
// If the topic doesn't exist, the operation succeeds silently.
Undeploy(ctx context.Context, namespace string, name string) error
}
TopicDeployer provides operations for deploying and managing Kafka topics in Kubernetes. It handles both creation and updates of KafkaTopic custom resources, as well as their removal.
func NewTopicDeployer ¶
func NewTopicDeployer( clientset versioned.Interface, ) TopicDeployer
NewTopicDeployer creates a new TopicDeployer instance.
Parameters:
- clientset: Strimzi clientset for interacting with KafkaTopic resources
Returns:
- TopicDeployer: A new deployer instance for managing Kafka topics
Directories
¶
| Path | Synopsis |
|---|---|
|
k8s
|
|
|
apis/kafka.strimzi.io/v1beta2
Package v1beta2 is the v1beta2 version of the API.
|
Package v1beta2 is the v1beta2 version of the API. |
|
client/clientset/versioned/fake
This package has the automatically generated fake clientset.
|
This package has the automatically generated fake clientset. |
|
client/clientset/versioned/scheme
This package contains the scheme of the automatically generated clientset.
|
This package contains the scheme of the automatically generated clientset. |
|
client/clientset/versioned/typed/kafka.strimzi.io/v1beta2
This package has the automatically generated typed clients.
|
This package has the automatically generated typed clients. |
|
client/clientset/versioned/typed/kafka.strimzi.io/v1beta2/fake
Package fake has the automatically generated clients.
|
Package fake has the automatically generated clients. |
|
Code generated by counterfeiter.
|
Code generated by counterfeiter. |