diff options
author | Michael Muré <batolettre@gmail.com> | 2020-09-26 14:06:01 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2020-09-29 20:42:21 +0200 |
commit | cedcc2772c88b78bc62594afd06c44c7a7c244e4 (patch) | |
tree | c08a7924ba65b1f52982e3591c8e009422323b7b | |
parent | cdfbecf3e2b874f0b9dd99b75bcb80aa5be8b4b4 (diff) | |
download | git-bug-cedcc2772c88b78bc62594afd06c44c7a7c244e4.tar.gz |
repo: smaller interfaces
-rw-r--r-- | repository/repo.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/repository/repo.go b/repository/repo.go index 3deb6f1b..6349007b 100644 --- a/repository/repo.go +++ b/repository/repo.go @@ -22,6 +22,12 @@ type Repo interface { RepoData } +// ClockedRepo is a Repo that also has Lamport clocks +type ClockedRepo interface { + Repo + RepoClock +} + // RepoConfig access the configuration of a repository type RepoConfig interface { // LocalConfig give access to the repository scoped configuration @@ -103,10 +109,8 @@ type RepoData interface { ListCommits(ref string) ([]Hash, error) } -// ClockedRepo is a Repo that also has Lamport clocks -type ClockedRepo interface { - Repo - +// RepoClock give access to Lamport clocks +type RepoClock interface { // GetOrCreateClock return a Lamport clock stored in the Repo. // If the clock doesn't exist, it's created. GetOrCreateClock(name string) (lamport.Clock, error) @@ -127,7 +131,11 @@ type ClockLoader struct { // TestedRepo is an extended ClockedRepo with function for testing only type TestedRepo interface { ClockedRepo + repoTest +} +// repoTest give access to test only functions +type repoTest interface { // AddRemote add a new remote to the repository AddRemote(name string, url string) error } |