Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Source ¶
type Source interface { // New returns a new uninitialized instance. New() Source // Init initializes this instance using user-provided properties. // Call the EventHandler when an event happened. Init(properties *runtime.RawExtension, eh eventhandler.EventHandler) error // Run starts this Source. You should handle the context so that you can // know when to exit. Run(ctx context.Context) error // Type returns the type of this Source. Name your source as something-doer, // instead of do-something. Type() string }
Source is an interface for sources. Anything that implements this interface can be registered as Sources, and will be executed automatically.
type SourceMeta ¶
type SourceMeta struct { // Type is the name (identifier) of this Source. Type string `json:"type"` // Properties are user-provided parameters. You should parse it yourself. Properties map[string]interface{} `json:"properties"` }
SourceMeta is what users type in their configurations, specifying what source they want to use and what properties they provided.
Click to show internal directories.
Click to hide internal directories.