rules

package
v0.9.1-alpha Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

				return make(event.RuleSetChangedEventQueue, defaultQueueSize)
			},
			fx.OnStop(
				func(queue event.RuleSetChangedEventQueue, logger zerolog.Logger) {
					logger.Debug().Msg("Closing rule set event queue")

					close(queue)
				},
			),
		),
		NewRuleFactory,
		fx.Annotate(
			newRepository,
			fx.OnStart(func(ctx context.Context, o *repository) error { return o.Start(ctx) }),
			fx.OnStop(func(ctx context.Context, o *repository) error { return o.Stop(ctx) }),
		),
		func(r *repository) rule.Repository { return r },
		NewRuleSetProcessor,
	),
	provider.Module,
)

Module is invoked on app bootstrapping. nolint: gochecknoglobals

Functions

func NewRuleFactory

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

func NewRuleSetProcessor

func NewRuleSetProcessor(
	queue event.RuleSetChangedEventQueue, factory rule.Factory, logger zerolog.Logger,
) rule.SetProcessor

Types

type CheckFunc

type CheckFunc func() error

Jump to

Keyboard shortcuts

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