Documentation ¶
Index ¶
- Variables
- func GitReleaseSegments(m *Metadata) (org, repo, tag string, err error)
- func HasPlatform(m Metadata, platform string) bool
- func PlatformNames(platforms []Platform) []string
- type ExactStrategy
- type Framework
- type Metadata
- type MetadataSearchStrategy
- type MetadataService
- type PackageStrategy
- type Platform
- type SearchOptions
- type UnavailableError
Constants ¶
This section is empty.
Variables ¶
var ( PackageFromFile = node.PackageFromFile NewConstraint = semver.NewConstraint )
Monkey patch functions to allow mocking during unit testing
Functions ¶
func GitReleaseSegments ¶ added in v0.30.0
GitReleaseSegments segments GitRelease into separate parts of org, repo and tag. Returns an error if GitRelease is malformed. The expected GitRelease format is "org/repo:tag".
func HasPlatform ¶ added in v0.101.0
HasPlatform returns true if the provided Metadata has a matching platform.
func PlatformNames ¶ added in v0.101.0
PlatformNames extracts platform names from the given platforms and returns them.
Types ¶
type ExactStrategy ¶ added in v0.90.0
type ExactStrategy struct { }
ExactStrategy searches for the metadata of a framework by its exact version
func (ExactStrategy) Find ¶ added in v0.90.0
func (s ExactStrategy) Find(ctx context.Context, svc MetadataService, frameworkName string, frameworkVersion string) (Metadata, error)
type Metadata ¶ added in v0.30.0
type Metadata struct { FrameworkName string FrameworkVersion string EOLDate time.Time RemovalDate time.Time DockerImage string GitRelease string Platforms []Platform CloudRunnerVersion string BrowserDefaults map[string]string }
Metadata represents test runner metadata.
func (*Metadata) IsDeprecated ¶ added in v0.121.0
func (*Metadata) IsFlaggedForRemoval ¶ added in v0.121.0
type MetadataSearchStrategy ¶ added in v0.90.0
type MetadataSearchStrategy interface {
Find(ctx context.Context, svc MetadataService, frameworkName string, searchValue string) (Metadata, error)
}
MetadataSearchStrategy is a generic strategy for determining if the requested framework version is supported
func NewSearchStrategy ¶ added in v0.90.0
func NewSearchStrategy(version string, rootDir string) MetadataSearchStrategy
NewSearchStrategy returns a concrete MetadataSearchStrategy
type MetadataService ¶ added in v0.30.0
type MetadataService interface { Search(ctx context.Context, opts SearchOptions) (Metadata, error) Frameworks(ctx context.Context) ([]Framework, error) Versions(ctx context.Context, frameworkName string) ([]Metadata, error) }
MetadataService represents an interface for retrieving framework metadata.
type PackageStrategy ¶ added in v0.90.0
type PackageStrategy struct {
// contains filtered or unexported fields
}
PackageStrategy searches for metadata of a framework from a package.json file. If the requested version is a range (e.g. ~9.0.0), it matches the most recent version that satisfies the constraint.
func (PackageStrategy) Find ¶ added in v0.90.0
func (s PackageStrategy) Find(ctx context.Context, svc MetadataService, frameworkName string, frameworkVersion string) (Metadata, error)
type SearchOptions ¶ added in v0.30.0
SearchOptions represents read query options for MetadataService.Search().
type UnavailableError ¶ added in v0.106.0
type UnavailableError struct {}
UnavailableError is an error type returned if the requested framework version is unavailable.
func (*UnavailableError) Error ¶ added in v0.106.0
func (e *UnavailableError) Error() string
Error returns the error string