Documentation ¶
Overview ¶
Package spreso provides types that represent the contents of a `Package.resolved` file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BranchPinState ¶
A BranchPinState represents a source control branch.
func NewBranchPinState ¶
func NewBranchPinState(name, revision string) *BranchPinState
NewBranchPinState returns a branch pin state.
func (*BranchPinState) Commit ¶
func (bps *BranchPinState) Commit() string
Commit returns the source control commit value (e.g., hash).
func (*BranchPinState) PinStateType ¶
func (bps *BranchPinState) PinStateType() PinStateType
PinStateType returns the type of pin state.
type PackageReference ¶
type PackageReference struct { Identity string Kind PkgRefKind Location string Name string }
A PackageReference represents a serialized form of PackageModel.PackageReference https://github.com/apple/swift-package-manager/blob/main/Sources/PackageModel/PackageReference.swift
func NewPkgRefFromV1Pin ¶
func NewPkgRefFromV1Pin(v1p *V1Pin) (*PackageReference, error)
func NewPkgRefFromV2Pin ¶
func NewPkgRefFromV2Pin(v2p *V2Pin) (*PackageReference, error)
func (*PackageReference) Remote ¶
func (pr *PackageReference) Remote() string
Remote returns the location of the remote package.
type Pin ¶
type Pin struct { PkgRef *PackageReference State PinState }
A Pin is the normalized representation for a resolved Swift package.
func NewPinFromV1Pin ¶
func NewPinFromV2Pin ¶
func NewPinsFromResolvedPackageJSON ¶
NewPinsFromResolvedPackageJSON returns the pins (resolved Swift package details) from `Package.resolved` JSON.
func NewPinsFromV1PinStore ¶
func NewPinsFromV1PinStore(ps *V1PinStore) ([]*Pin, error)
func NewPinsFromV2PinStore ¶
func NewPinsFromV2PinStore(ps *V2PinStore) ([]*Pin, error)
type PinState ¶
type PinState interface {
PinStateType() PinStateType
}
A PinState is the interface that all underlying pin state representations must implement.
func NewPinStateFromV1PinState ¶
func NewPinStateFromV1PinState(ps *V1PinState) PinState
func NewPinStateFromV2PinState ¶
func NewPinStateFromV2PinState(ps *V2PinState) (PinState, error)
type PinStateType ¶
type PinStateType int
A PinStateType is an enum for the representation type for the pin state.
const ( UnknownPinStateType PinStateType = iota BranchPinStateType VersionPinStateType RevisionPinStateType )
type PkgRefKind ¶
type PkgRefKind int
A PkgRefKind is an enum representing the kind of package reference.
const ( UnknownPkgRefKind PkgRefKind = iota RootPkgRefKind FileSystemPkgRefKind LocalSourceControlPkgRefKind RemoteSourceControlPkgRefKind RegistryPkgRefKind )
func (*PkgRefKind) UnmarshalJSON ¶
func (prk *PkgRefKind) UnmarshalJSON(b []byte) error
type RevisionPinState ¶
type RevisionPinState struct {
Revision string
}
A RevisionPinState represents a commit value/hash pin state.
func NewRevisionPinState ¶
func NewRevisionPinState(revision string) *RevisionPinState
NewRevisionPinState returns a commit value pin state.
func (*RevisionPinState) Commit ¶
func (rps *RevisionPinState) Commit() string
Commit returns the source control commit value (e.g., hash).
func (*RevisionPinState) PinStateType ¶
func (rps *RevisionPinState) PinStateType() PinStateType
PinStateType returns the type of pin state.
type V1Container ¶
type V1Container struct {
Pins []*V1Pin
}
type V1Pin ¶
type V1Pin struct { Package string RepositoryURL string State *V1PinState }
type V1PinState ¶
type V1PinStore ¶
type V1PinStore struct { Version int Object *V1Container }
A V1PinStore represents PinStorage.V1. https://github.com/apple/swift-package-manager/blob/main/Sources/PackageGraph/PinsStore.swift#L230
type V2PinKind ¶
type V2PinKind int
func (V2PinKind) PkgRefKind ¶
func (vpk V2PinKind) PkgRefKind() PkgRefKind
func (*V2PinKind) UnmarshalJSON ¶
type V2PinState ¶
type V2PinStore ¶
A V2PinStore represents PinStorage.V2. https://github.com/apple/swift-package-manager/blob/main/Sources/PackageGraph/PinsStore.swift#L230
type VersionPinState ¶
A VersionPinState represents a semver tagged pin state.
func NewVersionPinState ¶
func NewVersionPinState(version, revision string) *VersionPinState
NewVersionPinState returns a semver tagged pin state.
func (*VersionPinState) Commit ¶
func (vps *VersionPinState) Commit() string
Commit returns the source control commit value (e.g., hash).
func (*VersionPinState) PinStateType ¶
func (vps *VersionPinState) PinStateType() PinStateType
PinStateType returns the type of pin state.