rules

package
v0.6.1-alpha Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Module = fx.Options(
	fx.Provide(func(logger zerolog.Logger) event.RuleSetChangedEventQueue {
		logger.Debug().Msg("Creating rule set event queue.")

		return make(event.RuleSetChangedEventQueue, defaultQueueSize)
	}),
	fx.Provide(NewRepository, NewRuleFactory),
	fx.Invoke(registerRuleDefinitionHandler, registerRuleSetChangedEventQueueCloser),
	provider.Module,
)

Module is invoked on app bootstrapping. nolint: gochecknoglobals

Functions

This section is empty.

Types

type Repository

type Repository interface {
	FindRule(*url.URL) (rule.Rule, error)
}

func NewRepository

func NewRepository(
	queue event.RuleSetChangedEventQueue,
	ruleFactory RuleFactory,
	logger zerolog.Logger,
) (Repository, error)

type RuleFactory

type RuleFactory interface {
	CreateRule(srcID string, ruleConfig rule.Configuration) (rule.Rule, error)
	HasDefaultRule() bool
	DefaultRule() rule.Rule
}

func NewRuleFactory

func NewRuleFactory(hf mechanisms.Factory, conf *config.Configuration, logger zerolog.Logger) (
	RuleFactory, error,
)

Jump to

Keyboard shortcuts

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