Documentation
¶
Index ¶
- Variables
- type AbstractTrigger
- func (at *AbstractTrigger) AllocateWorkerAndSubmitEvent(event nuclio.Event, functionLogger logger.Logger, timeout time.Duration) (response interface{}, submitError error, processError error)
- func (at *AbstractTrigger) AllocateWorkerAndSubmitEvents(events []nuclio.Event, functionLogger logger.Logger, timeout time.Duration) (responses []interface{}, submitError error, processErrors []error)
- func (at *AbstractTrigger) GetClass() string
- func (at *AbstractTrigger) GetID() string
- func (at *AbstractTrigger) GetKind() string
- func (at *AbstractTrigger) GetStatistics() *Statistics
- func (at *AbstractTrigger) GetWorkers() []*worker.Worker
- func (at *AbstractTrigger) HandleSubmitPanic(workerInstance *worker.Worker, submitError *error)
- func (at *AbstractTrigger) Initialize() error
- func (at *AbstractTrigger) SubmitEventToWorker(functionLogger logger.Logger, workerInstance *worker.Worker, ...) (response interface{}, processError error)
- func (at *AbstractTrigger) UpdateStatistics(success bool)
- type Configuration
- type Creator
- type Factory
- type Registry
- type Secret
- type SecretRef
- type Statistics
- type Trigger
Constants ¶
This section is empty.
Variables ¶
View Source
var RegistrySingleton = Registry{ Registry: *registry.NewRegistry("trigger"), }
global singleton
Functions ¶
This section is empty.
Types ¶
type AbstractTrigger ¶
type AbstractTrigger struct {
ID string
Logger logger.Logger
WorkerAllocator worker.Allocator
Class string
Kind string
Statistics Statistics
}
AbstractTrigger implements common trigger operations
func (*AbstractTrigger) AllocateWorkerAndSubmitEvent ¶
func (at *AbstractTrigger) AllocateWorkerAndSubmitEvent(event nuclio.Event, functionLogger logger.Logger, timeout time.Duration) (response interface{}, submitError error, processError error)
AllocateWorkerAndSubmitEvent submits event to allocated worker
func (*AbstractTrigger) AllocateWorkerAndSubmitEvents ¶
func (at *AbstractTrigger) AllocateWorkerAndSubmitEvents(events []nuclio.Event, functionLogger logger.Logger, timeout time.Duration) (responses []interface{}, submitError error, processErrors []error)
AllocateWorkerAndSubmitEvents submits multiple events to an allocated worker
func (*AbstractTrigger) GetClass ¶
func (at *AbstractTrigger) GetClass() string
GetClass returns the class
func (*AbstractTrigger) GetID ¶
func (at *AbstractTrigger) GetID() string
GetID returns user given ID for this trigger
func (*AbstractTrigger) GetKind ¶
func (at *AbstractTrigger) GetKind() string
GetKind return the kind
func (*AbstractTrigger) GetStatistics ¶
func (at *AbstractTrigger) GetStatistics() *Statistics
GetStatistics returns trigger statistics
func (*AbstractTrigger) GetWorkers ¶
func (at *AbstractTrigger) GetWorkers() []*worker.Worker
GetWorkers returns the list of workers
func (*AbstractTrigger) HandleSubmitPanic ¶
func (at *AbstractTrigger) HandleSubmitPanic(workerInstance *worker.Worker, submitError *error)
HandleSubmitPanic handles a panic when submitting to worker
func (*AbstractTrigger) Initialize ¶
func (at *AbstractTrigger) Initialize() error
Initialize performs post creation initializations
func (*AbstractTrigger) SubmitEventToWorker ¶
func (at *AbstractTrigger) SubmitEventToWorker(functionLogger logger.Logger, workerInstance *worker.Worker, event nuclio.Event) (response interface{}, processError error)
SubmitEventToWorker submits events to worker and returns response
func (*AbstractTrigger) UpdateStatistics ¶
func (at *AbstractTrigger) UpdateStatistics(success bool)
UpdateStatistics updates the trigger statistics
type Configuration ¶
type Configuration struct {
functionconfig.Trigger
// the runtime configuration, for reference
RuntimeConfiguration *runtime.Configuration
// a unique trigger ID
ID string
}
func NewConfiguration ¶
func NewConfiguration(ID string, triggerConfiguration *functionconfig.Trigger, runtimeConfiguration *runtime.Configuration) *Configuration
type Creator ¶
type Creator interface {
// Create creates a trigger instance
Create(logger.Logger, string, *functionconfig.Trigger, *runtime.Configuration, map[string]worker.Allocator) (Trigger, error)
}
Creator creates a trigger instance
type Statistics ¶
func (*Statistics) DiffFrom ¶
func (s *Statistics) DiffFrom(prev *Statistics) Statistics
type Trigger ¶
type Trigger interface {
// Initialize performs post creation initializations
Initialize() error
// start creating events from a given checkpoint (nil - no checkpoint)
Start(checkpoint functionconfig.Checkpoint) error
// stop creating events. returns the current checkpoint
Stop(force bool) (functionconfig.Checkpoint, error)
// get the user given ID for this trigger
GetID() string
// get the class of source (sync, async, etc)
GetClass() string
// get specific kind of source (http, rabbit mq, etc)
GetKind() string
// get the configuration
GetConfig() map[string]interface{}
// get statistics
GetStatistics() *Statistics
// get direct access to workers for things like housekeeping / management
// TODO: locks and such when relevant
GetWorkers() []*worker.Worker
}
Click to show internal directories.
Click to hide internal directories.