Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AngularDetector ¶
type AngularDetector interface { // DetectAngular takes the content of a js file and returns true if the plugin is using Angular. DetectAngular(js []byte) bool }
AngularDetector implements a check to see if a js file is using angular APIs.
type ContainsBytesDetector ¶
type ContainsBytesDetector struct {
Pattern []byte
}
ContainsBytesDetector is an AngularDetector that returns true if module.js contains the "pattern" string.
func (*ContainsBytesDetector) DetectAngular ¶
func (d *ContainsBytesDetector) DetectAngular(moduleJs []byte) bool
DetectAngular returns true if moduleJs contains the byte slice d.pattern.
type DetectorsProvider ¶
type DetectorsProvider interface { // ProvideDetectors returns a slice of AngularDetector. ProvideDetectors(ctx context.Context) []AngularDetector }
DetectorsProvider can provide multiple AngularDetectors used for Angular detection.
type RegexDetector ¶
RegexDetector is an AngularDetector that returns true if the module.js content matches a regular expression.
func (*RegexDetector) DetectAngular ¶
func (d *RegexDetector) DetectAngular(moduleJs []byte) bool
DetectAngular returns true if moduleJs matches the regular expression d.regex.
type SequenceDetectorsProvider ¶
type SequenceDetectorsProvider []DetectorsProvider
SequenceDetectorsProvider is a DetectorsProvider that wraps a slice of other DetectorsProvider, and returns the first provided result that isn't empty.
func (SequenceDetectorsProvider) ProvideDetectors ¶
func (p SequenceDetectorsProvider) ProvideDetectors(ctx context.Context) []AngularDetector
type StaticDetectorsProvider ¶
type StaticDetectorsProvider struct {
Detectors []AngularDetector
}
StaticDetectorsProvider is a DetectorsProvider that always returns a pre-defined slice of AngularDetector.
func (*StaticDetectorsProvider) ProvideDetectors ¶
func (p *StaticDetectorsProvider) ProvideDetectors(_ context.Context) []AngularDetector