service

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FeatureEmitter = "emitter"
)

features known to the service for providing some functionalities

Variables

View Source
var Services = map[string]*Service{}

Services holds a catalog of running services in this daemon process.

Functions

func ReceiverFeatures

func ReceiverFeatures(c *config.DataSet) map[string]interface{}

ReceiverFeatures goes through the config data to figure out what driver/feature to start for receiving events

func StartEngine

func StartEngine(cfg *config.Config)

StartEngine Starts the engine service

func StartOperator

func StartOperator(cfg *config.Config)

StartOperator starts the operator service

func StartReceiver

func StartReceiver(cfg *config.Config)

StartReceiver starts the receiver service.

Types

type CollapsedRule

type CollapsedRule struct {
	Trigger      *config.CollapsedTrigger
	OriginalRule *config.Rule
}

CollapsedRule maps the rule to its all collapsed match and exports.

type ExpectHandler

type ExpectHandler func(*dipper.Message)

ExpectHandler is a function type that handles expected message.

type MessageResponder

type MessageResponder func(*driver.Runtime, *dipper.Message)

MessageResponder is a function type that respond to messages.

type RoutedMessage

type RoutedMessage struct {
	// contains filtered or unexported fields
}

RoutedMessage stores a dipper message and its destination.

type Service

type Service struct {
	dipper.RPCCaller

	Route            func(*dipper.Message) []RoutedMessage
	DiscoverFeatures func(*config.DataSet) map[string]interface{}
	ServiceReload    func(*config.Config)
	EmitMetrics      func()
	// contains filtered or unexported fields
}

Service is a collection of daemon's feature.

func NewService

func NewService(cfg *config.Config, name string) *Service

NewService creates a service with given config and name.

func (*Service) CounterIncr

func (s *Service) CounterIncr(name string, tags []string)

CounterIncr increases a counter metric.

func (*Service) GaugeSet

func (s *Service) GaugeSet(name string, value string, tags []string)

GaugeSet sets the value for a gauge metric.

func (*Service) GetName added in v1.0.1

func (s *Service) GetName() string

func (*Service) GetStream added in v1.0.1

func (s *Service) GetStream(feature string) io.Writer

func (*Service) Reload

func (s *Service) Reload()

Reload the service when configuration changes are detected.

type WorkflowHelper added in v1.0.0

type WorkflowHelper struct {
	// contains filtered or unexported fields
}

WorkflowHelper enables workflow engine to load config and send messages

func (*WorkflowHelper) GetConfig added in v1.0.0

func (h *WorkflowHelper) GetConfig() *config.Config

GetConfig method feed config from service to workflow engine

func (*WorkflowHelper) SendMessage added in v1.0.0

func (h *WorkflowHelper) SendMessage(msg *dipper.Message)

SendMessage method sends workflow messages to eventbus channle

Jump to

Keyboard shortcuts

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