angulardetectorsprovider

package
v11.1.4-modfix Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 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.

func ProvideDynamic

func ProvideDynamic(cfg *setting.Cfg, store angularpatternsstore.Service) (*Dynamic, error)

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

type GCOMResponse

type GCOMResponse struct {
	Patterns GCOMPatterns
	ETag     string
}

Jump to

Keyboard shortcuts

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