Skip to content

Commit cbe8c18

Browse files
authoredApr 10, 2017
Merge pull request sdboyer/gps#206 from spenczar/release_source_manager
Add Release() to the SourceManager interface
2 parents 584844e + ed4342d commit cbe8c18

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed
 

‎bridge.go

+11-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,17 @@ import (
1212
// sourceBridges provide an adapter to SourceManagers that tailor operations
1313
// for a single solve run.
1414
type sourceBridge interface {
15-
SourceManager // composes SourceManager
15+
// sourceBridge includes all the methods in the SourceManager interface except
16+
// for Release().
17+
SourceExists(ProjectIdentifier) (bool, error)
18+
SyncSourceFor(ProjectIdentifier) error
19+
ListVersions(ProjectIdentifier) ([]Version, error)
20+
RevisionPresentIn(ProjectIdentifier, Revision) (bool, error)
21+
ListPackages(ProjectIdentifier, Version) (pkgtree.PackageTree, error)
22+
GetManifestAndLock(ProjectIdentifier, Version, ProjectAnalyzer) (Manifest, Lock, error)
23+
ExportProject(ProjectIdentifier, Version, string) error
24+
DeduceProjectRoot(ip string) (ProjectRoot, error)
25+
1626
verifyRootDir(path string) error
1727
pairRevision(id ProjectIdentifier, r Revision) []Version
1828
pairVersion(id ProjectIdentifier, v UnpairedVersion) PairedVersion

‎source_manager.go

+5
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,11 @@ type SourceManager interface {
6363
// DeduceRootProject takes an import path and deduces the corresponding
6464
// project/source root.
6565
DeduceProjectRoot(ip string) (ProjectRoot, error)
66+
67+
// Release lets go of any locks held by the SourceManager. Once called, it is
68+
// no longer safe to call methods against it; all method calls will
69+
// immediately result in errors.
70+
Release()
6671
}
6772

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

0 commit comments

Comments
 (0)
Please sign in to comment.