/
githubmirror
/
grafana
Обзор
Документация
Войти
/
githubmirror
/
grafana
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
pkg/plugins/manager/loader/angular/angularinspector/fakes.go
33 строки
925 B
Giuseppe Guerra
Plugins: Angular detector: Remote patterns fetching (#69843)
26 июн 2023, 16:33
Не верифицирован
26 июн 2023, 16:33
cca9d89
Код
Авторство
О чём код?
package angularinspector import ( "context" "github.com/grafana/grafana/pkg/plugins" ) // FakeInspector is an inspector whose Inspect function can be set to any function. type FakeInspector struct { // InspectFunc is the function called when calling Inspect() InspectFunc func(ctx context.Context, p *plugins.Plugin) (bool, error) } func (i *FakeInspector) Inspect(ctx context.Context, p *plugins.Plugin) (bool, error) { return i.InspectFunc(ctx, p) } 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 }, } )