Documentation ¶
Overview ¶
Example (Full) ¶
package main import ( "embed" "os" eventingv1alpha1 "knative.dev/eventing-kafka-broker/control-plane/pkg/apis/eventing/v1alpha1" "knative.dev/eventing-kafka-broker/test/e2e_new/resources/kafkasink" "knative.dev/reconciler-test/pkg/manifest" ) //go:embed *.yaml var yaml embed.FS func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "topic": "my-topic", "bootstrapServers": []string{"my-bootstrap-server:8082"}, } kafkasink.WithContentMode(eventingv1alpha1.ModeBinary)(cfg) kafkasink.WithReplicationFactor(3)(cfg) kafkasink.WithNumPartitions(10)(cfg) kafkasink.WithAuthSecretName("abc")(cfg) files, err := manifest.ExecuteYAML(yaml, images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: eventing.knative.dev/v1alpha1 kind: KafkaSink metadata: name: foo namespace: bar spec: topic: "my-topic" bootstrapServers: - "my-bootstrap-server:8082" contentMode: binary numPartitions: 10 replicationFactor: 3 auth: secret: ref: name: abc
Example (Zero) ¶
package main import ( "embed" "os" "knative.dev/reconciler-test/pkg/manifest" ) //go:embed *.yaml var yaml embed.FS func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "topic": "my-topic", "bootstrapServers": []string{"my-bootstrap-server:8082"}, } files, err := manifest.ExecuteYAML(yaml, images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: eventing.knative.dev/v1alpha1 kind: KafkaSink metadata: name: foo namespace: bar spec: topic: "my-topic" bootstrapServers: - "my-bootstrap-server:8082"
Index ¶
- func Install(name, topic, bootstrapServers []string, opts ...manifest.CfgFn) feature.StepFn
- func IsReady(name string, timing ...time.Duration) feature.StepFn
- func WithAuthSecretName(name string) manifest.CfgFn
- func WithContentMode(contentMode string) manifest.CfgFn
- func WithNumPartitions(numPartitions int32) manifest.CfgFn
- func WithReplicationFactor(replicationFactor int16) manifest.CfgFn
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithAuthSecretName ¶
WithAuthSecretName adds the auth secret name
func WithContentMode ¶
WithContentMode adds the content mode
func WithNumPartitions ¶
WithNumPartitions adds the num of partitions
func WithReplicationFactor ¶
WithReplicationFactor adds the replication factor
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.