kafkasource

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: Apache-2.0 Imports: 8 Imported by: 1

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

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func GVR

func Install

func Install(name string, opts ...manifest.CfgFn) feature.StepFn

Install will create a KafkaSource resource, using the latest version, augmented with the config fn options.

func IsReady

func IsReady(name string, timings ...time.Duration) feature.StepFn

IsReady tests to see if a KafkaSource becomes ready within the time given.

func WithAnnotations

func WithAnnotations(annotations map[string]string) manifest.CfgFn

WithAnnotations adds annotation to a KafkaSource metadata.

func WithBootstrapServers

func WithBootstrapServers(bootstrapServers []string) manifest.CfgFn

WithBootstrapServers adds the bootstrapServers config to a KafkaSource spec.

func WithSASLEnabled

func WithSASLEnabled() manifest.CfgFn

WithSASLEnabled enables SASL to a KafkaSource spec.

func WithSASLPassword

func WithSASLPassword(name, key string) manifest.CfgFn

WithSASLPassword adds the SASL password config to a KafkaSource spec.

func WithSASLType

func WithSASLType(name, key string) manifest.CfgFn

WithSASLType adds the SASL type config to a KafkaSource spec.

func WithSASLUser

func WithSASLUser(name, key string) manifest.CfgFn

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

func WithTLSCACert(name, key string) manifest.CfgFn

WithTLSCACert adds the TLS caCert config to a KafkaSource spec.

func WithTLSCert

func WithTLSCert(name, key string) manifest.CfgFn

WithTLSCert adds the TLS cert config to a KafkaSource spec.

func WithTLSEnabled

func WithTLSEnabled() manifest.CfgFn

WithTLSEnabled enables TLS to a KafkaSource spec.

func WithTLSKey

func WithTLSKey(name, key string) manifest.CfgFn

WithTLSKey adds the TLS key config to a KafkaSource spec.

func WithTopics

func WithTopics(topics []string) manifest.CfgFn

WithTopics adds the topics config to a KafkaSource spec.

func WithVersion

func WithVersion(version string) manifest.CfgFn

WithVersion overrides the default API version

Types

This section is empty.

Jump to

Keyboard shortcuts

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