Documentation ¶
Overview ¶
Example (Full) ¶
package main import ( "os" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "schedule": "*/1 * * * *", "contentType": "application/json", "data": `{"message": "Hello world!"}`, "sink": map[string]interface{}{ "ref": map[string]string{ "kind": "sinkkind", "namespace": "sinknamespace", "name": "sinkname", "apiVersion": "sinkversion", }, "uri": "uri/parts", }, } files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: sources.knative.dev/v1beta2 kind: PingSource metadata: name: foo namespace: bar spec: schedule: '*/1 * * * *' contentType: 'application/json' data: '{"message": "Hello world!"}' sink: ref: kind: sinkkind namespace: bar name: sinkname apiVersion: sinkversion uri: uri/parts
Example (Fullbase64) ¶
package main import ( "os" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "schedule": "*/1 * * * *", "contentType": "application/json", "dataBase64": "aabbccddeeff", "sink": map[string]interface{}{ "ref": map[string]string{ "kind": "sinkkind", "namespace": "sinknamespace", "name": "sinkname", "apiVersion": "sinkversion", }, "uri": "uri/parts", }, } files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: sources.knative.dev/v1beta2 kind: PingSource metadata: name: foo namespace: bar spec: schedule: '*/1 * * * *' contentType: 'application/json' dataBase64: 'aabbccddeeff' sink: ref: kind: sinkkind namespace: bar name: sinkname apiVersion: sinkversion uri: uri/parts
Example (Min) ¶
package main import ( "os" "knative.dev/reconciler-test/pkg/manifest" ) func main() { images := map[string]string{} cfg := map[string]interface{}{ "name": "foo", "namespace": "bar", "brokerName": "baz", } files, err := manifest.ExecuteLocalYAML(images, cfg) if err != nil { panic(err) } manifest.OutputYAML(os.Stdout, files) }
Output: apiVersion: sources.knative.dev/v1beta2 kind: PingSource 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 WithData(contentType, data string) manifest.CfgFn
- func WithDataBase64(contentType, dataBase64 string) manifest.CfgFn
- func WithSink(ref *duckv1.KReference, uri string) manifest.CfgFn
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Gvr ¶
func Gvr() schema.GroupVersionResource
func WithDataBase64 ¶
WithDataBase64 adds the contentType and dataBase64 config to a PingSource spec.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.