Skip to content
This repository has been archived by the owner on Feb 3, 2018. It is now read-only.

Add Release() to the SourceManager interface #206

Merged
merged 5 commits into from
Apr 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion bridge.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,17 @@ import (
// sourceBridges provide an adapter to SourceManagers that tailor operations
// for a single solve run.
type sourceBridge interface {
SourceManager // composes SourceManager
// sourceBridge includes all the methods in the SourceManager interface except
// for Release().
SourceExists(ProjectIdentifier) (bool, error)
SyncSourceFor(ProjectIdentifier) error
ListVersions(ProjectIdentifier) ([]Version, error)
RevisionPresentIn(ProjectIdentifier, Revision) (bool, error)
ListPackages(ProjectIdentifier, Version) (pkgtree.PackageTree, error)
GetManifestAndLock(ProjectIdentifier, Version, ProjectAnalyzer) (Manifest, Lock, error)
ExportProject(ProjectIdentifier, Version, string) error
DeduceProjectRoot(ip string) (ProjectRoot, error)

verifyRootDir(path string) error
pairRevision(id ProjectIdentifier, r Revision) []Version
pairVersion(id ProjectIdentifier, v UnpairedVersion) PairedVersion
Expand Down
5 changes: 5 additions & 0 deletions source_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ type SourceManager interface {
// DeduceRootProject takes an import path and deduces the corresponding
// project/source root.
DeduceProjectRoot(ip string) (ProjectRoot, error)

// Release lets go of any locks held by the SourceManager. Once called, it is
// no longer safe to call methods against it; all method calls will
// immediately result in errors.
Release()
}

// A ProjectAnalyzer is responsible for analyzing a given path for Manifest and
Expand Down