navidshaikh / kn-plugin-event

Kn plugin for sending events to Knative sinks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

kn-plugin-event

kn-plugin-event is a plugin of Knative Client, for managing cloud events from command line.

Description

With this plugin, you can build and send the cloud events to publicly available addresses (URLs) or to Addressable (Kubernetes service, Knative service, broker, channels, etc).

Build and Install

You must set up your development environment before you build.

Building:

Once you've set up your development environment, let's build the plugin.

$ go build -o kn-event ./cmd/kn-event/main.go

You'll get an executable plugin binary namely kn-event in your current dir. You're ready to use kn-event as a stand alone binary, check the available commands ./kn-event -h.

Installing:

If you'd like to use the plugin with kn CLI, install the plugin by simply copying the executable file under kn plugins directory as:

mkdir -p ~/.config/kn/plugins
cp kn-event ~/.config/kn/plugins

Check if plugin is loaded

kn -h

Run it

kn event -h

Examples

Send an event:

Send an event to a Knative service event-display in namespace default:

$ kn event send \
    --type org.example.kn.ping \
    --id $(uuidgen) \
    --field event.type=test \
    --field event.data=ping \
    --to Service:v1:event-display \
    --namespace default \

About

Kn plugin for sending events to Knative sinks.

License:Apache License 2.0


Languages

Language:Go 98.1%Language:Shell 1.9%