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") )
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 ¶ added in v0.2.0
func ValidateTarget(args *TargetArgs) error
ValidateTarget will perform validation on App element of target.
Types ¶
type App ¶ added in v0.3.0
App object.
func (*App) CreateWithArgs ¶ added in v0.3.0
func (c *App) CreateWithArgs(args *EventArgs) (*cloudevents.Event, error)
CreateWithArgs will create an event by parsing given args.
func (*App) PresentWith ¶ added in v0.3.0
func (c *App) PresentWith(e *cloudevents.Event, output OutputMode) (string, error)
PresentWith will present an event with specified output.
func (*App) Send ¶ added in v0.3.0
func (c *App) Send(ce cloudevents.Event, target *TargetArgs, options *OptionsArgs) error
Send will send CloudEvent to target.
type OptionsArgs ¶ added in v0.2.0
type OptionsArgs 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 OutWriter io.Writer ErrWriter io.Writer }
OptionsArgs holds a general args for all commands.
func (*OptionsArgs) WithLogger ¶ added in v0.2.0
func (opts *OptionsArgs) WithLogger() *event.Properties
WithLogger will create an event suitable OptionsArgs from CLI ones.
type OutputMode ¶
OutputMode is type of output to produce.
const ( HumanReadable OutputMode = iota JSON YAML )
OutputMode enumeration values.
Click to show internal directories.
Click to hide internal directories.