github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/atc/db/input_mapping.go (about)

     1  package db
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/pf-qiu/concourse/v6/atc"
     7  )
     8  
     9  type ResolutionFailure string
    10  
    11  const (
    12  	LatestVersionNotFound ResolutionFailure = "latest version of resource not found"
    13  	VersionNotFound       ResolutionFailure = "version of resource not found"
    14  	NoSatisfiableBuilds   ResolutionFailure = "no satisfiable builds from passed jobs found for set of inputs"
    15  )
    16  
    17  type PinnedVersionNotFound struct {
    18  	PinnedVersion atc.Version
    19  }
    20  
    21  func (p PinnedVersionNotFound) String() ResolutionFailure {
    22  	var text string
    23  	for k, v := range p.PinnedVersion {
    24  		text += fmt.Sprintf(" %s:%s", k, v)
    25  	}
    26  	return ResolutionFailure(fmt.Sprintf("pinned version%s not found", text))
    27  }
    28  
    29  type JobSet map[int]bool
    30  
    31  type InputMapping map[string]InputResult
    32  
    33  type InputResult struct {
    34  	Input          *AlgorithmInput
    35  	PassedBuildIDs []int
    36  	ResolveError   ResolutionFailure
    37  }
    38  
    39  type ResourceVersion string
    40  
    41  type AlgorithmVersion struct {
    42  	ResourceID int
    43  	Version    ResourceVersion
    44  }
    45  
    46  type AlgorithmInput struct {
    47  	AlgorithmVersion
    48  	FirstOccurrence bool
    49  }
    50  
    51  type AlgorithmOutput struct {
    52  	AlgorithmVersion
    53  	InputName string
    54  }