Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // AlwaysAngularFakeInspector is an inspector that always returns `true, nil` AlwaysAngularFakeInspector = &FakeInspector{ InspectFunc: func(_ context.Context, _ *plugins.Plugin) (bool, error) { return true, nil }, } // NeverAngularFakeInspector is an inspector that always returns `false, nil` NeverAngularFakeInspector = &FakeInspector{ InspectFunc: func(_ context.Context, _ *plugins.Plugin) (bool, error) { return false, nil }, } )
Functions ¶
func NewDefaultStaticDetectorsProvider ¶
func NewDefaultStaticDetectorsProvider() angulardetector.DetectorsProvider
NewDefaultStaticDetectorsProvider returns a new StaticDetectorsProvider with the default (static, hardcoded) angular detection patterns (defaultDetectors)
Types ¶
type FakeInspector ¶
type FakeInspector struct { // InspectFunc is the function called when calling Inspect() InspectFunc func(ctx context.Context, p *plugins.Plugin) (bool, error) }
FakeInspector is an inspector whose Inspect function can be set to any function.
type Inspector ¶
type Inspector interface { // Inspect takes a plugin and checks if the plugin is using Angular. Inspect(ctx context.Context, p *plugins.Plugin) (bool, error) }
Inspector can inspect a plugin and determine if it's an Angular plugin or not.
func NewStaticInspector ¶
NewStaticInspector returns the default Inspector, which is a PatternsListInspector that only uses the static (hardcoded) angular detection patterns.
type PatternsListInspector ¶
type PatternsListInspector struct { // DetectorsProvider returns the detectors that will be used by Inspect. DetectorsProvider angulardetector.DetectorsProvider }
PatternsListInspector is an Inspector that matches a plugin's module.js against all the patterns returned by the detectorsProvider, in sequence.
Click to show internal directories.
Click to hide internal directories.