Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrUnsupportedOutputMode if user passed unsupported output mode. ErrUnsupportedOutputMode = errors.New("unsupported output mode") // ErrInvalidFormat if user pass an un-parsable format. ErrInvalidFormat = errors.New("invalid format") // ErrCantBuildEvent if event can't be built. ErrCantBuildEvent = errors.New("can't build event") // ErrCantMarshalEvent if event can't be marshalled to text. ErrCantMarshalEvent = errors.New("can't marshal event") )
View Source
var ( // ErrCantUseBothToURLAndToFlags will be raised if user use both --to and // --to-url flags. ErrCantUseBothToURLAndToFlags = errors.New("can't use both --to and --to-url flags") // ErrUseToURLOrToFlagIsRequired will be raised if user didn't used --to or // --to-url flags. ErrUseToURLOrToFlagIsRequired = errors.New("use --to or --to-url flag is required") // ErrInvalidURLFormat will be raised if given URL is invalid. ErrInvalidURLFormat = errors.New("invalid URL format") // ErrInvalidToFormat will be raised if given addressable doesn't have valid // expected format. ErrInvalidToFormat = errors.New("--to flag needs to be in format " + "kind:apiVersion:name for named resources or " + "kind:apiVersion:labelKey1=value1,labelKey2=value2 for matching via " + "a label selector") )
Functions ¶
func ValidateTarget ¶
func ValidateTarget(args *TargetArgs) error
ValidateTarget will perform validation on App element of target.
Types ¶
type App ¶
type App struct { event.Binding system.Environment }
App object.
func (*App) CreateWithArgs ¶
func (a *App) CreateWithArgs(args *EventArgs) (*cloudevents.Event, error)
CreateWithArgs will create an event by parsing given args.
func (*App) PresentWith ¶
func (a *App) PresentWith(e *cloudevents.Event, output OutputMode) (string, error)
PresentWith will present an event with specified output.
func (*App) Send ¶
func (a *App) Send(ce cloudevents.Event, target TargetArgs, options *Options) error
Send will send CloudEvent to target.
type Options ¶
type Options struct { event.KnPluginOptions // Output define type of output commands should be producing. Output OutputMode // Verbose tells does commands should display additional information about // what's happening? Verbose information is printed on stderr. Verbose bool }
Options holds a general args for all commands.
func (*Options) WithLogger ¶
WithLogger will create an event suitable Options from CLI ones.
type OutputMode ¶
OutputMode is type of output to produce.
const ( HumanReadable OutputMode = iota JSON YAML )
OutputMode enumeration values.
type PluginVersionOutput ¶
type PluginVersionOutput struct { Name string `json:"name" yaml:"name"` Version string `json:"version" yaml:"version"` Image string `json:"image" yaml:"image"` }
PluginVersionOutput is a struct that is used to output project version in machine readable format.
Click to show internal directories.
Click to hide internal directories.