Documentation ¶
Overview ¶
Example (Full) ¶
images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", } WithVersion("v1")(cfg) WithAnnotations(map[string]string{ "autoscaling.knative.dev/class": "keda.autoscaling.knative.dev", "autoscaling.knative.dev/minScale": "0", })(cfg) WithBootstrapServers([]string{"baz"})(cfg) WithTopics([]string{"t1", "t2"})(cfg) WithTLSCert("tlscertname", "tlscertkey")(cfg) WithTLSKey("tlskeyname", "tlskeykey")(cfg) WithTLSCACert("tlscaCertname", "tlscaCertkey")(cfg) WithSASLUser("saslusername", "sasluserkey")(cfg) WithSASLPassword("saslpwdname", "saslpwdkey")(cfg) WithSASLType("sasltypename", "sasltypekey")(cfg) WithSink(&duckv1.KReference{Kind: "Service", Name: "name", APIVersion: "v1"}, "")(cfg) files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files)
Output: apiVersion: sources.knative.dev/v1 kind: KafkaSource metadata: name: foo namespace: bar annotations: autoscaling.knative.dev/class: "keda.autoscaling.knative.dev" autoscaling.knative.dev/minScale: "0" spec: bootstrapServers: - "baz" topics: - "t1" - "t2" net: tls: enable: true cert: secretKeyRef: name: "tlscertname" key: "tlscertkey" key: secretKeyRef: name: "tlskeyname" key: "tlskeykey" caCert: secretKeyRef: name: "tlscaCertname" key: "tlscaCertkey" sasl: enable: true user: secretKeyRef: name: "saslusername" key: "sasluserkey" password: secretKeyRef: name: "saslpwdname" key: "saslpwdkey" type: secretKeyRef: name: "sasltypename" key: "sasltypekey" sink: ref: kind: Service namespace: bar name: name apiVersion: v1
Example (Min) ¶
images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "version": "v1beta1", } files, err := manifest.ExecuteYAML(yaml, images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files)
Output: apiVersion: sources.knative.dev/v1beta1 kind: KafkaSource metadata: name: foo namespace: bar spec:
Index ¶
- func GVR() schema.GroupVersionResource
- func Install(name string, opts ...manifest.CfgFn) feature.StepFn
- func IsReady(name string, timings ...time.Duration) feature.StepFn
- func WithAnnotations(annotations map[string]string) manifest.CfgFn
- func WithBootstrapServers(bootstrapServers []string) manifest.CfgFn
- func WithSASLEnabled() manifest.CfgFn
- func WithSASLPassword(name, key string) manifest.CfgFn
- func WithSASLType(name, key string) manifest.CfgFn
- func WithSASLUser(name, key string) manifest.CfgFn
- func WithSink(ref *duckv1.KReference, uri string) manifest.CfgFn
- func WithTLSCACert(name, key string) manifest.CfgFn
- func WithTLSCert(name, key string) manifest.CfgFn
- func WithTLSEnabled() manifest.CfgFn
- func WithTLSKey(name, key string) manifest.CfgFn
- func WithTopics(topics []string) manifest.CfgFn
- func WithVersion(version string) manifest.CfgFn
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GVR ¶
func GVR() schema.GroupVersionResource
func Install ¶
Install will create a KafkaSource resource, using the latest version, augmented with the config fn options.
func WithAnnotations ¶
WithAnnotations adds annotation to a KafkaSource metadata.
func WithBootstrapServers ¶
WithBootstrapServers adds the bootstrapServers config to a KafkaSource spec.
func WithSASLEnabled ¶
WithSASLEnabled enables SASL to a KafkaSource spec.
func WithSASLPassword ¶
WithSASLPassword adds the SASL password config to a KafkaSource spec.
func WithSASLType ¶
WithSASLType adds the SASL type config to a KafkaSource spec.
func WithSASLUser ¶
WithSASLUser adds the SASL user config to a KafkaSource spec.
func WithSink ¶
func WithSink(ref *duckv1.KReference, uri string) manifest.CfgFn
WithSink adds the sink related config to a PingSource spec.
func WithTLSCACert ¶
WithTLSCACert adds the TLS caCert config to a KafkaSource spec.
func WithTLSCert ¶
WithTLSCert adds the TLS cert config to a KafkaSource spec.
func WithTLSEnabled ¶
WithTLSEnabled enables TLS to a KafkaSource spec.
func WithTLSKey ¶
WithTLSKey adds the TLS key config to a KafkaSource spec.
func WithTopics ¶
WithTopics adds the topics config to a KafkaSource spec.
func WithVersion ¶
WithVersion overrides the default API version
Types ¶
This section is empty.