Other(refactor): Implement locations in Bridge

This commit is contained in:
James Houlahan
2022-08-19 11:12:34 +02:00
committed by Jakub
parent e4f08f79c3
commit ee5a126c1c
3 changed files with 16 additions and 4 deletions

View File

@ -1,13 +1,13 @@
package bridge
func (bridge *Bridge) ProvideLogsPath() (string, error) {
panic("TODO")
return bridge.locations.ProvideLogsPath()
}
func (bridge *Bridge) GetLicenseFilePath() string {
panic("TODO")
return bridge.locations.GetLicenseFilePath()
}
func (bridge *Bridge) GetDependencyLicensesLink() string {
panic("TODO")
return bridge.locations.GetDependencyLicensesLink()
}

View File

@ -24,9 +24,13 @@ import (
)
type Locator interface {
ProvideLogsPath() (string, error)
GetLicenseFilePath() string
GetDependencyLicensesLink() string
Clear() error
ClearUpdates() error
ProvideLogsPath() (string, error)
}
type CacheProvider interface {

View File

@ -45,6 +45,14 @@ func (l *fakeLocations) ProvideSettingsPath() (string, error) {
return l.dir, nil
}
func (l *fakeLocations) GetDependencyLicensesLink() string {
return "/path/to/dependencies"
}
func (l *fakeLocations) GetLicenseFilePath() string {
return "/path/to/license"
}
func (l *fakeLocations) Clear() error {
return os.RemoveAll(l.dir)
}