sensors

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 38 Imported by: 1

Documentation

Overview

Copyright 2018 BlackRock, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SensorContext added in v0.13.0

type SensorContext struct {
	// KubeClient is the kubernetes client
	KubeClient kubernetes.Interface
	// ClientPool manages a pool of dynamic clients.
	DynamicClient dynamic.Interface
	// Sensor object
	Sensor *v1alpha1.Sensor
	// EventBus config
	EventBusConfig *eventbusv1alpha1.BusConfig
	// EventBus subject
	EventBusSubject string
	// contains filtered or unexported fields
}

SensorContext contains execution context for Sensor

func NewSensorContext added in v0.13.0

func NewSensorContext(kubeClient kubernetes.Interface, dynamicClient dynamic.Interface, sensor *v1alpha1.Sensor, eventBusConfig *eventbusv1alpha1.BusConfig, eventBusSubject string) *SensorContext

NewSensorContext returns a new sensor execution context.

func (*SensorContext) GetTrigger added in v0.13.0

func (sensorCtx *SensorContext) GetTrigger(ctx context.Context, trigger *v1alpha1.Trigger) Trigger

GetTrigger returns a trigger

func (*SensorContext) ListenEvents added in v0.13.0

func (sensorCtx *SensorContext) ListenEvents(ctx context.Context, stopCh <-chan struct{}) error

ListenEvents watches and handles events received from the gateway.

type Trigger added in v0.13.0

type Trigger interface {
	// FetchResource fetches the trigger resource from external source
	FetchResource() (interface{}, error)
	// ApplyResourceParameters applies parameters to the trigger resource
	ApplyResourceParameters(events map[string]*v1alpha1.Event, resource interface{}) (interface{}, error)
	// Execute executes the trigger
	Execute(events map[string]*v1alpha1.Event, resource interface{}) (interface{}, error)
	// ApplyPolicy applies the policy on the trigger
	ApplyPolicy(resource interface{}) error
}

Trigger interface

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL