Documentation ¶
Index ¶
- Variables
- type Constraint
- type ConstraintType
- type Dependency
- type InfoLevel
- type Lock
- type ProjectDep
- type ProjectExistence
- type ProjectID
- type ProjectIdentifier
- type ProjectInfo
- type Result
- type SolveError
- type SolveFailure
- type Solver
- type SourceManager
- type Spec
- type Version
- type VersionQueue
- type VersionType
Constants ¶
This section is empty.
Variables ¶
View Source
var VTCTCompat = [...]ConstraintType{ C_Revision, C_Branch, C_Version, C_Semver | C_SemverRange, }
Functions ¶
This section is empty.
Types ¶
type Constraint ¶
type Constraint interface { Type() ConstraintType Body() string Allows(Version) bool UnionAllowsAny(Constraint) bool }
func NewConstraint ¶
func NewConstraint(t ConstraintType, body string) (Constraint, error)
NewConstraint constructs an appropriate Constraint object from the input parameters.
type ConstraintType ¶
type ConstraintType uint8
const ( C_Revision ConstraintType = 1 << iota C_Branch C_Version C_Semver C_SemverRange C_ExactMatch = C_Revision | C_Branch | C_Version | C_Semver C_FlexMatch = C_SemverRange )
type Dependency ¶
type Dependency struct { Depender ProjectID Dep ProjectDep }
type Lock ¶
type Lock interface { // Indicates the version of the solver used to generate this lock file SolverVersion() string // The hash of inputs to the solver that resulted in this lock file InputHash() string // Returns the identifier for a project in the lock file, or nil if the // named project is not present in the lock file GetProjectID(ProjectIdentifier) *ProjectID }
type ProjectDep ¶
type ProjectDep struct { ID ProjectIdentifier Constraint Constraint }
type ProjectExistence ¶
type ProjectExistence uint8
ProjectExistence values represent the extent to which a project "exists."
const ( // DoesNotExist indicates that a particular project URI cannot be located, // at any level. It is represented as 1, rather than 0, to differentiate it // from the zero-value (which is ExistenceUnknown). DoesNotExist ProjectExistence = 1 << iota // ExistsInLock indicates that a project exists (i.e., is mentioned in) a // lock file. // TODO not sure if it makes sense to have this IF it's just the source // manager's responsibility for putting this together - the implication is // that this is the root lock file, right? ExistsInLock // ExistsInVendor indicates that a project exists in a vendor directory at // the predictable location based on import path. It does NOT imply, much // less guarantee, any of the following: // - That the code at the expected location under vendor is at the version // given in a lock file // - That the code at the expected location under vendor is from the // expected upstream project at all // - That, if this flag is not present, the project does not exist at some // unexpected/nested location under vendor // - That the full repository history is available. In fact, the // assumption should be that if only this flag is on, the full repository // history is likely not available locally // // In short, the information encoded in this flag should in no way be // construed as exhaustive. ExistsInVendor // ExistsInCache indicates that a project exists on-disk in the local cache. // It does not guarantee that an upstream exists, thus it cannot imply // that the cache is at all correct - up-to-date, or even of the expected // upstream project repository. // // Additionally, this refers only to the existence of the local repository // itself; it says nothing about the existence or completeness of the // separate metadata cache. ExistsInCache // ExistsUpstream indicates that a project repository was locatable at the // path provided by a project's URI (a base import path). ExistsUpstream // Indicates that the upstream project, in addition to existing, is also // accessible. // // Different hosting providers treat unauthorized access differently: // GitHub, for example, returns 404 (or the equivalent) when attempting unauthorized // access, whereas BitBucket returns 403 (or 302 login redirect). Thus, // while the ExistsUpstream and UpstreamAccessible bits should always only // be on or off together when interacting with Github, it is possible that a // BitBucket provider might report ExistsUpstream, but not UpstreamAccessible. // // For most purposes, non-existence and inaccessibility are treated the // same, but clearly delineating the two allows slightly improved UX. UpstreamAccessible // The zero value; indicates that no work has yet been done to determine the // existence level of a project. ExistenceUnknown ProjectExistence = 0 )
type ProjectIdentifier ¶
type ProjectIdentifier string
type ProjectInfo ¶
ProjectInfo holds the spec and lock information for a given ProjectID
type Result ¶
type Result struct { // A list of the projects selected by the solver. nil if solving failed. Projects []ProjectID // The number of solutions that were attempted Attempts int // The error that ultimately prevented reaching a successful conclusion. nil // if solving was successful. // TODO proper error types SolveFailure error }
type SolveError ¶
type SolveFailure ¶
type SolveFailure uint
const ( // Indicates that no version solution could be found NoVersionSolution SolveFailure = 1 << iota IncompatibleVersionType )
type Solver ¶
type Solver interface {
Solve(root ProjectInfo, toUpgrade []ProjectIdentifier) Result
}
func NewSolver ¶
func NewSolver(sm SourceManager) Solver
type SourceManager ¶
type SourceManager interface { GetProjectInfo(ProjectID) (ProjectInfo, error) ListVersions(ProjectIdentifier) ([]ProjectID, error) ProjectExists(ProjectIdentifier) bool }
type Spec ¶
type Spec interface { ID() ProjectIdentifier GetDependencies() []ProjectDep GetDevDependencies() []ProjectDep }
type Version ¶
type Version struct { // The type of version identifier Type VersionType // The version identifier itself Info string SemVer *semver.Version }
type VersionQueue ¶
type VersionQueue struct {
// contains filtered or unexported fields
}
func NewVersionQueue ¶
func NewVersionQueue(ref ProjectIdentifier, lockv *ProjectID, sm SourceManager) (*VersionQueue, error)
type VersionType ¶
type VersionType uint8
The type of the version - branch, revision, or version
const ( V_Revision VersionType = iota V_Branch V_Version V_Semver )
Click to show internal directories.
Click to hide internal directories.