Other(refactor): Move Locations out of frontend

This commit is contained in:
James Houlahan
2022-08-18 15:51:40 +02:00
committed by Jakub
parent 2aaec3b6bd
commit e4f08f79c3
8 changed files with 22 additions and 17 deletions

View File

@ -31,7 +31,6 @@ import (
"github.com/ProtonMail/proton-bridge/v2/internal/config/useragent"
"github.com/ProtonMail/proton-bridge/v2/internal/events"
"github.com/ProtonMail/proton-bridge/v2/internal/frontend/types"
"github.com/ProtonMail/proton-bridge/v2/internal/locations"
"github.com/ProtonMail/proton-bridge/v2/internal/updater"
"github.com/ProtonMail/proton-bridge/v2/internal/users"
"github.com/ProtonMail/proton-bridge/v2/pkg/keychain"
@ -52,7 +51,6 @@ type Service struct { // nolint:structcheck
eventStreamDoneCh chan struct{}
panicHandler types.PanicHandler
locations *locations.Locations
settings *settings.Settings
eventListener listener.Listener
updater types.Updater
@ -75,7 +73,6 @@ type Service struct { // nolint:structcheck
func NewService(
showOnStartup bool,
panicHandler types.PanicHandler,
locations *locations.Locations,
settings *settings.Settings,
eventListener listener.Listener,
updater types.Updater,
@ -88,7 +85,6 @@ func NewService(
s := Service{
UnimplementedBridgeServer: UnimplementedBridgeServer{},
panicHandler: panicHandler,
locations: locations,
settings: settings,
eventListener: eventListener,
updater: updater,

View File

@ -205,7 +205,7 @@ func (s *Service) Version(context.Context, *emptypb.Empty) (*wrapperspb.StringVa
func (s *Service) LogsPath(context.Context, *emptypb.Empty) (*wrapperspb.StringValue, error) {
s.log.Info("LogsPath")
path, err := s.locations.ProvideLogsPath()
path, err := s.bridge.ProvideLogsPath()
if err != nil {
s.log.WithError(err).Error("Cannot determine logs path")
return nil, err
@ -215,11 +215,11 @@ func (s *Service) LogsPath(context.Context, *emptypb.Empty) (*wrapperspb.StringV
func (s *Service) LicensePath(context.Context, *emptypb.Empty) (*wrapperspb.StringValue, error) {
s.log.Info("LicensePath")
return wrapperspb.String(s.locations.GetLicenseFilePath()), nil
return wrapperspb.String(s.bridge.GetLicenseFilePath()), nil
}
func (s *Service) DependencyLicensesLink(context.Context, *emptypb.Empty) (*wrapperspb.StringValue, error) {
return wrapperspb.String(s.locations.GetDependencyLicensesLink()), nil
return wrapperspb.String(s.bridge.GetDependencyLicensesLink()), nil
}
func (s *Service) ReleaseNotesPageLink(context.Context, *emptypb.Empty) (*wrapperspb.StringValue, error) {