eventsource

package
v0.0.0-...-2f10389 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegistrySingleton = Registry{
	Registry: *registry.NewRegistry("event_source"),
}

global singleton

Functions

This section is empty.

Types

type AbstractEventSource

type AbstractEventSource struct {
	ID              string
	Logger          nuclio.Logger
	WorkerAllocator worker.Allocator
	Class           string
	Kind            string
	Statistics      Statistics
}

func (*AbstractEventSource) AllocateWorkerAndSubmitEvent

func (aes *AbstractEventSource) AllocateWorkerAndSubmitEvent(event nuclio.Event,
	functionLogger nuclio.Logger,
	timeout time.Duration) (response interface{}, submitError error, processError error)

func (*AbstractEventSource) AllocateWorkerAndSubmitEvents

func (aes *AbstractEventSource) AllocateWorkerAndSubmitEvents(events []nuclio.Event,
	functionLogger nuclio.Logger,
	timeout time.Duration) (responses []interface{}, submitError error, processErrors []error)

func (*AbstractEventSource) GetClass

func (aes *AbstractEventSource) GetClass() string

func (*AbstractEventSource) GetID

func (aes *AbstractEventSource) GetID() string

get user given ID for this event source

func (*AbstractEventSource) GetKind

func (aes *AbstractEventSource) GetKind() string

func (*AbstractEventSource) GetStatistics

func (aes *AbstractEventSource) GetStatistics() *Statistics

get statistics

func (*AbstractEventSource) GetWorkers

func (aes *AbstractEventSource) GetWorkers() []*worker.Worker

func (*AbstractEventSource) SubmitEventToWorker

func (aes *AbstractEventSource) SubmitEventToWorker(functionLogger nuclio.Logger,
	workerInstance *worker.Worker,
	event nuclio.Event) (response interface{}, processError error)

type Checkpoint

type Checkpoint *string

type Configuration

type Configuration struct {
	ID string
}

func NewConfiguration

func NewConfiguration(configuration *viper.Viper) *Configuration

type Creator

type Creator interface {
	Create(logger nuclio.Logger,
		eventSourceConfiguration *viper.Viper,
		runtimeConfiguration *viper.Viper) (EventSource, error)
}

type EventSource

type EventSource interface {

	// start creating events from a given checkpoint (nil - no checkpoint)
	Start(checkpoint Checkpoint) error

	// stop creating events. returns the current checkpoint
	Stop(force bool) (Checkpoint, error)

	// get the user given ID for this event source
	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
}

type Registry

type Registry struct {
	registry.Registry
}

func (*Registry) NewEventSource

func (r *Registry) NewEventSource(logger nuclio.Logger,
	kind string,
	eventSourceConfiguration *viper.Viper,
	runtimeConfiguration *viper.Viper) (EventSource, error)

type Statistics

type Statistics struct {
	EventsHandleSuccessTotal uint64
	EventsHandleFailureTotal uint64
}

func (*Statistics) DiffFrom

func (s *Statistics) DiffFrom(prev *Statistics) Statistics

Jump to

Keyboard shortcuts

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