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

Commit

Permalink
Merge pull request #206 from spenczar/release_source_manager
Browse files Browse the repository at this point in the history
Add Release() to the SourceManager interface
  • Loading branch information
sdboyer authored Apr 10, 2017
2 parents 6db8155 + c240c2a commit 9659997
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
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

0 comments on commit 9659997

Please sign in to comment.