sensors

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2020 License: Apache-2.0 Imports: 34 Imported by: 0

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.

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 {
	// SensorClient is the client for Sensor
	SensorClient sensorclientset.Interface
	// KubeClient is the kubernetes client
	KubeClient kubernetes.Interface
	// ClientPool manages a pool of dynamic clients.
	DynamicClient dynamic.Interface
	// Sensor object
	Sensor *v1alpha1.Sensor
	// Logger for the Sensor
	Logger *logrus.Logger
	// NotificationQueue is internal NotificationQueue to manage incoming events
	NotificationQueue chan *types.Notification
	// ControllerInstanceID is the instance ID of Sensor controller processing this Sensor
	ControllerInstanceID string
	// Updated indicates update to Sensor resource
	Updated bool
	// contains filtered or unexported fields
}

SensorContext contains execution context for Sensor

func NewSensorContext added in v0.13.0

func NewSensorContext(sensorClient sensorclientset.Interface, kubeClient kubernetes.Interface, dynamicClient dynamic.Interface, sensor *v1alpha1.Sensor, controllerInstanceID string) *SensorContext

NewSensorContext returns a new sensor execution context.

func (*SensorContext) GetTrigger added in v0.13.0

func (sensorCtx *SensorContext) GetTrigger(trigger *v1alpha1.Trigger) Trigger

GetTrigger returns a trigger

func (*SensorContext) ListenEvents added in v0.13.0

func (sensorCtx *SensorContext) ListenEvents() 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(sensor *v1alpha1.Sensor, resource interface{}) (interface{}, error)
	// Execute executes the trigger
	Execute(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