Documentation ¶
Index ¶
- Constants
- Variables
- func CreateFromSpec(spec *Spec) (*cloudevents.Event, error)
- func DefaultSource() string
- func NewDefault() *cloudevents.Event
- func NewID() string
- func UnmarshalData(bytes []byte) (map[string]interface{}, error)
- type AddressableSpec
- type Binding
- type CreateSender
- type FieldSpec
- type KnPluginOptions
- type Properties
- type Sender
- type Spec
- type Target
- type TargetType
Constants ¶
const DefaultKubeconfig = "~/.kube/config"
DefaultKubeconfig is a default location of kubeconfig.
const (
// DefaultType holds a default type for a event.
DefaultType = "dev.knative.cli.plugin.event.generic"
)
Variables ¶
var ErrNotYetImplemented = errors.New("not yet implemented")
ErrNotYetImplemented is an error for not yet implemented code.
Functions ¶
func CreateFromSpec ¶
func CreateFromSpec(spec *Spec) (*cloudevents.Event, error)
CreateFromSpec will create an event by parsing given args.
func UnmarshalData ¶
UnmarshalData will take bytes and unmarshall it as JSON to map structure.
Types ¶
type AddressableSpec ¶ added in v0.2.0
AddressableSpec specify destination of a event to be sent, as well as sender namespace that should be used to create a sender Job in.
type Binding ¶ added in v0.3.0
type Binding struct {
CreateSender
}
Binding holds injectable dependencies.
type CreateSender ¶ added in v0.3.0
CreateSender creates a Sender.
type FieldSpec ¶
type FieldSpec struct { Path string Value interface{} }
FieldSpec holds a specification of a event's data field.
type KnPluginOptions ¶ added in v0.2.0
type KnPluginOptions struct { // KnConfig holds kn configuration file (default: ~/.config/kn/config.yaml) KnConfig string // Kubeconfig holds kubectl configuration file (default: ~/.kube/config) Kubeconfig string // LogHTTP tells if kn-event plugin should log HTTP requests it makes LogHTTP bool }
KnPluginOptions holds options inherited to every Kn plugin.
type Properties ¶ added in v0.2.0
type Properties struct { KnPluginOptions Log *zap.SugaredLogger }
Properties holds a general properties.
type Sender ¶ added in v0.2.0
type Sender interface { // Send will send cloudevents.Event to configured target, or return an error // if one occur. Send(ce cloudevents.Event) error }
Sender will send event to specified target.
type Target ¶ added in v0.2.0
type Target struct { Type TargetType URLVal *url.URL AddressableVal *AddressableSpec *Properties }
Target is a target to send event to.
type TargetType ¶ added in v0.2.0
type TargetType int
TargetType specify a type of a event target.
const ( // TargetTypeReachable specify a type of event target that is network // reachable, and direct HTTP communication can be performed. TargetTypeReachable TargetType = iota // TargetTypeAddressable represent a type of event target that is cluster // private, and direct communication can't be performed. In this case in // cluster sender Job will be created to send the event. TargetTypeAddressable )