Documentation ¶
Index ¶
Constants ¶
View Source
const (
// DefaultType holds a default type for an event.
DefaultType = "dev.knative.cli.plugin.event.generic"
)
Variables ¶
View Source
var ( // ErrCantMarshalAsJSON is returned if given CE data can't be marshalled // as JSON. ErrCantMarshalAsJSON = errors.New("can't marshal as JSON") // ErrCantSetField is returned if given field can't be applied. ErrCantSetField = errors.New("can't set field") )
View Source
var ErrCantSentEvent = errors.New("can't sent event")
ErrCantSentEvent if event can't be sent.
View Source
var ErrUnexpected = errors.New("unexpected")
ErrUnexpected if unexpected error found.
Functions ¶
func CreateFromSpec ¶
func CreateFromSpec(spec *Spec) (*cloudevents.Event, error)
CreateFromSpec will create an event by parsing given args.
Types ¶
type Binding ¶
type Binding struct { CreateSender k8s.NewKubeClients }
Binding holds injectable dependencies.
type CreateSender ¶
type CreateSender func(cfg *k8s.Configurator, target *Target) (Sender, error)
CreateSender creates a Sender.
type FieldSpec ¶
type FieldSpec struct { Path string Value interface{} }
FieldSpec holds a specification of a event's data field.
type Sender ¶
type Sender interface { // Send will send cloudevents.Event to configured target, or return an error // if one occurs. Send(ctx context.Context, ce cloudevents.Event) error }
Sender will send event to specified target.
Click to show internal directories.
Click to hide internal directories.