sensors

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: Apache-2.0 Imports: 48 Imported by: 2

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 {
	// 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, hostname string, metrics *sensormetrics.Metrics) *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) Start added in v1.3.0

func (sensorCtx *SensorContext) Start(ctx context.Context) error

type Trigger added in v0.13.0

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

Trigger interface

Jump to

Keyboard shortcuts

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