angulardetectorsprovider

package
v0.0.0-...-fb7f86c Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dynamic

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

Dynamic is an angulardetector.DetectorsProvider that calls GCOM to get Angular detection patterns, converts them to detectors and caches them for all future calls. It also provides a background service that will periodically refresh the patterns from GCOM. If the feature flag FlagPluginsDynamicAngularDetectionPatterns is disabled, the background service is disabled.

func ProvideDynamic

func ProvideDynamic(cfg *config.Cfg, store angularpatternsstore.Service, features featuremgmt.FeatureToggles) (*Dynamic, error)

func (*Dynamic) IsDisabled

func (d *Dynamic) IsDisabled() bool

IsDisabled returns true if FlagPluginsDynamicAngularDetectionPatterns is not enabled.

func (*Dynamic) ProvideDetectors

func (d *Dynamic) ProvideDetectors(_ context.Context) []angulardetector.AngularDetector

ProvideDetectors returns the cached detectors. It returns an empty slice if there's no value.

func (*Dynamic) Run

func (d *Dynamic) Run(ctx context.Context) error

Run is the function implementing the background service and updates the detectors periodically.

type GCOMPattern

type GCOMPattern struct {
	Name    string
	Pattern string
	Type    GCOMPatternType
}

GCOMPattern is an Angular detection pattern returned by the GCOM API.

type GCOMPatternType

type GCOMPatternType string

GCOMPatternType is a pattern type returned by the GCOM API.

const (
	GCOMPatternTypeContains GCOMPatternType = "contains"
	GCOMPatternTypeRegex    GCOMPatternType = "regex"
)

type GCOMPatterns

type GCOMPatterns []GCOMPattern

GCOMPatterns is a slice of GCOMPattern

Jump to

Keyboard shortcuts

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