algorithm

package
v3.4.1-wings+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInput

type BuildInput struct {
	ResourceVersion
	BuildID   int
	JobID     int
	InputName string
}

type BuildOutput

type BuildOutput struct {
	ResourceVersion
	BuildID int
	JobID   int
}

type BuildSet

type BuildSet map[int]struct{}

func (BuildSet) Contains

func (set BuildSet) Contains(buildID int) bool

func (BuildSet) Equal

func (set BuildSet) Equal(otherSet BuildSet) bool

func (BuildSet) Intersect

func (set BuildSet) Intersect(otherSet BuildSet) BuildSet

func (BuildSet) Overlaps

func (set BuildSet) Overlaps(otherSet BuildSet) bool

func (BuildSet) String

func (set BuildSet) String() string

func (BuildSet) Union

func (set BuildSet) Union(otherSet BuildSet) BuildSet

type Constraint

type Constraint func(Version) bool

type Constraints

type Constraints []Constraint

func (Constraints) And

func (cs Constraints) And(constraint Constraint) Constraints

func (Constraints) Check

func (cs Constraints) Check(v Version) bool

type ExistingBuildResolver

type ExistingBuildResolver struct {
	BuildInputs []BuildInput
	JobID       int
	ResourceID  int
}

func (*ExistingBuildResolver) Exists

func (r *ExistingBuildResolver) Exists() bool

func (*ExistingBuildResolver) ExistsForVersion

func (r *ExistingBuildResolver) ExistsForVersion(versionID int) bool

type InputCandidates

type InputCandidates []InputVersionCandidates

func (InputCandidates) Pin

func (candidates InputCandidates) Pin(input int, version int)

func (InputCandidates) Reduce

func (candidates InputCandidates) Reduce(depth int, jobs JobSet) (ResolvedInputs, bool)

func (InputCandidates) String

func (candidates InputCandidates) String() string

func (InputCandidates) Unpin

func (candidates InputCandidates) Unpin(input int, inputCandidates InputVersionCandidates)

type InputConfig

type InputConfig struct {
	Name            string
	JobName         string
	Passed          JobSet
	UseEveryVersion bool
	PinnedVersionID int
	ResourceID      int
	JobID           int
}

type InputConfigs

type InputConfigs []InputConfig

func (InputConfigs) Resolve

func (configs InputConfigs) Resolve(db *VersionsDB) (InputMapping, bool)

type InputMapping

type InputMapping map[string]InputVersion

type InputVersion

type InputVersion struct {
	VersionID       int
	FirstOccurrence bool
}

type InputVersionCandidates

type InputVersionCandidates struct {
	Input                 string
	Passed                JobSet
	UseEveryVersion       bool
	PinnedVersionID       int
	ExistingBuildResolver *ExistingBuildResolver

	VersionCandidates
	// contains filtered or unexported fields
}

func (InputVersionCandidates) IsNext

func (inputVersionCandidates InputVersionCandidates) IsNext(version int, versionIDs *VersionsIter) bool

func (InputVersionCandidates) UsingEveryVersion

func (inputVersionCandidates InputVersionCandidates) UsingEveryVersion() bool

type JobSet

type JobSet map[int]struct{}

func (JobSet) Contains

func (set JobSet) Contains(jobID int) bool

func (JobSet) Equal

func (set JobSet) Equal(otherSet JobSet) bool

func (JobSet) Intersect

func (set JobSet) Intersect(otherSet JobSet) JobSet

func (JobSet) String

func (set JobSet) String() string

func (JobSet) Union

func (set JobSet) Union(otherSet JobSet) JobSet

type ResolvedInputs

type ResolvedInputs map[string]int

type ResourceVersion

type ResourceVersion struct {
	VersionID  int
	ResourceID int
	CheckOrder int
}

type Version

type Version struct {
	// contains filtered or unexported fields
}

func NewVersion

func NewVersion(candidate VersionCandidate) Version

func (Version) PassedAny

func (v Version) PassedAny(jobID int, builds BuildSet) bool

type VersionCandidate

type VersionCandidate struct {
	VersionID  int
	BuildID    int
	JobID      int
	CheckOrder int
}

func (VersionCandidate) String

func (candidate VersionCandidate) String() string

type VersionCandidates

type VersionCandidates struct {
	// contains filtered or unexported fields
}

func (*VersionCandidates) Add

func (candidates *VersionCandidates) Add(candidate VersionCandidate)

func (VersionCandidates) BuildIDs

func (candidates VersionCandidates) BuildIDs(jobID int) BuildSet

func (VersionCandidates) ForVersion

func (candidates VersionCandidates) ForVersion(versionID int) VersionCandidates

func (VersionCandidates) IntersectByVersion

func (candidates VersionCandidates) IntersectByVersion(other VersionCandidates) VersionCandidates

func (VersionCandidates) IsEmpty

func (candidates VersionCandidates) IsEmpty() bool

func (VersionCandidates) Len

func (candidates VersionCandidates) Len() int

func (*VersionCandidates) Merge

func (candidates *VersionCandidates) Merge(version Version)

func (VersionCandidates) PruneVersionsOfOtherBuildIDs

func (candidates VersionCandidates) PruneVersionsOfOtherBuildIDs(jobID int, buildIDs BuildSet) VersionCandidates

func (VersionCandidates) VersionIDs

func (candidates VersionCandidates) VersionIDs() *VersionsIter

type Versions

type Versions []Version

func (Versions) Merge

func (vs Versions) Merge(v Version) Versions

func (Versions) With

func (vs Versions) With(candidate VersionCandidate) Versions

type VersionsDB

type VersionsDB struct {
	ResourceVersions []ResourceVersion
	BuildOutputs     []BuildOutput
	BuildInputs      []BuildInput
	JobIDs           map[string]int
	ResourceIDs      map[string]int
}

func (VersionsDB) AllVersionsOfResource

func (db VersionsDB) AllVersionsOfResource(resourceID int) VersionCandidates

func (VersionsDB) FindVersionOfResource

func (db VersionsDB) FindVersionOfResource(resourceID int, versionID int) (VersionCandidate, bool)

func (VersionsDB) IsVersionFirstOccurrence

func (db VersionsDB) IsVersionFirstOccurrence(versionID int, jobID int, inputName string) bool

func (VersionsDB) LatestVersionOfResource

func (db VersionsDB) LatestVersionOfResource(resourceID int) (VersionCandidate, bool)

func (VersionsDB) VersionsOfResourcePassedJobs

func (db VersionsDB) VersionsOfResourcePassedJobs(resourceID int, passed JobSet) VersionCandidates

type VersionsIter

type VersionsIter struct {
	// contains filtered or unexported fields
}

func (*VersionsIter) Next

func (iter *VersionsIter) Next() (int, bool)

func (*VersionsIter) Peek

func (iter *VersionsIter) Peek() (int, bool)

Jump to

Keyboard shortcuts

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