detector

package
v1.11.8-beta-07 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	// Is detects based on upsert test options what kind of test it is
	Is(options apiClient.UpsertTestOptions) (string, bool)
	// IsWithPath detects based on path(extension) what kind of test it is
	IsWithPath(path string, options apiClient.UpsertTestOptions) (string, bool)
	// GetType returns test type
	GetType() string
}

Adapter defines methods for test detection

type Detector

type Detector struct {
	Adapters map[string]Adapter
}

Detector is detection orchestrator for possible detectors

func NewDefaultDetector

func NewDefaultDetector() Detector

func (*Detector) Add

func (d *Detector) Add(adapter Adapter)

Add adds adapter

func (*Detector) Detect

func (d *Detector) Detect(path string, options client.UpsertTestOptions) (name string, found bool)

Detect detects test type

func (*Detector) GetAdapter added in v1.5.13

func (d *Detector) GetAdapter(testType string) Adapter

GetAdapter return adapter by test type

Jump to

Keyboard shortcuts

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