sources

package
v0.0.0-...-d5b48cf Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// START specifies a Feed should be started
	StartFeed FeedOperation = "START"

	// STOP specifies a Feed should be stopped
	StopFeed FeedOperation = "STOP"

	// FeedOperationKey is the Env variable that gets set to requested FeedOperationKey
	FeedOperationKey string = "FEED_OPERATION"

	// FeedTriggerKey is the Env variable that gets set to serialized trigger configuration
	FeedTriggerKey string = "FEED_TRIGGER"

	// FeedTargetKey is the Env variable that gets set to target of the feed
	FeedTargetKey string = "FEED_TARGET"

	// FeedContextKey is the Env variable that gets set to serialized FeedContext if stopping
	FeedContextKey string = "FEED_CONTEXT"

	// EventSourceParametersKey is the Env variable that gets set to serialized EventSourceSpec
	EventSourceParametersKey string = "EVENT_SOURCE_PARAMETERS"

	// FeedNamespaceKey is the Env variable that gets set to namespace of the container performing
	// the Feed lifecycle operation (aka, namespace of the feed). Uses downward api
	FeedNamespaceKey string = "FEED_NAMESPACE"

	// FeedServiceAccount is the Env variable that gets set to serviceaccount of the
	// container performing the Feed operation. Uses downward api
	FeedServiceAccountKey string = "FEED_SERVICE_ACCOUNT"
)
View Source
const (
	// EventTriggerKey is the Env variable that gets set to EventTrigger
	EventTriggerKey string = "EVENT_TRIGGER"
)

Variables

This section is empty.

Functions

func GetFirstTerminationMessage

func GetFirstTerminationMessage(pod *corev1.Pod) string

func IsJobComplete

func IsJobComplete(job *batchv1.Job) bool

func IsJobFailed

func IsJobFailed(job *batchv1.Job) bool

func MakeJob

func MakeJob(feed *v1alpha1.Feed, spec *v1alpha1.EventSourceSpec, op FeedOperation, trigger EventTrigger, route string, feedContext FeedContext) (*batchv1.Job, error)

MakeJob creates a Job to complete a start or stop operation for a Feed.

func RunEventSource

func RunEventSource(es EventSource)

Types

type ContainerEventSource

type ContainerEventSource struct {

	// Namespace to run the container in
	Namespace string

	// ServiceAccount to run as
	ServiceAccountName string

	// Feed for this operation
	Feed *v1alpha1.Feed

	// EventSourceSpec for the actual underlying source
	EventSourceSpec *v1alpha1.EventSourceSpec
	// contains filtered or unexported fields
}

func (*ContainerEventSource) StartFeed

func (t *ContainerEventSource) StartFeed(trigger EventTrigger, route string) (*FeedContext, error)

func (*ContainerEventSource) StopFeed

func (t *ContainerEventSource) StopFeed(trigger EventTrigger, feedContext FeedContext) error

type EventSource

type EventSource interface {
	StartFeed(trigger EventTrigger, route string) (*FeedContext, error)
	StopFeed(trigger EventTrigger, feedContext FeedContext) error
}

func NewContainerEventSource

func NewContainerEventSource(feed *v1alpha1.Feed, kubeclientset kubernetes.Interface, spec *v1alpha1.EventSourceSpec) EventSource

type EventTrigger

type EventTrigger struct {
	// EventType is the type of event to be observed
	EventType string `json:"eventType"`

	// Resource is the resource(s) from which to observe events.
	Resource string `json:"resource"`

	// Service is the hostname of the service that should be observed.
	Service string `json:"service"`

	// Parameters is an opaque map of configuration needed by the EventSource.
	Parameters map[string]interface{} `json:"params"`
}

EventTrigger is a version of v1alpha1.EventTrigger where parameters have been resolved.

type FeedContext

type FeedContext struct {
	Context map[string]interface{}
}

type FeedOperation

type FeedOperation string

FeedOperation specifies whether we're starting or stopping

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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