2023-01-02 10:02:26 +00:00
|
|
|
// Copyright (c) 2023 Proton AG
|
2022-10-13 08:58:11 +00:00
|
|
|
//
|
|
|
|
// This file is part of Proton Mail Bridge.
|
|
|
|
//
|
|
|
|
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
//
|
|
|
|
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
2020-05-25 13:34:18 +00:00
|
|
|
package bridge
|
|
|
|
|
2021-01-27 08:16:04 +00:00
|
|
|
import (
|
2022-11-01 20:44:09 +00:00
|
|
|
"context"
|
|
|
|
|
2022-11-23 14:25:41 +00:00
|
|
|
"github.com/ProtonMail/proton-bridge/v3/internal/updater"
|
2021-01-27 08:16:04 +00:00
|
|
|
)
|
|
|
|
|
2020-11-23 10:56:57 +00:00
|
|
|
type Locator interface {
|
2022-08-26 15:00:21 +00:00
|
|
|
ProvideSettingsPath() (string, error)
|
2022-08-19 09:12:34 +00:00
|
|
|
ProvideLogsPath() (string, error)
|
2023-01-16 15:27:41 +00:00
|
|
|
ProvideGluonCachePath() (string, error)
|
2023-01-24 13:35:45 +00:00
|
|
|
ProvideGluonDataPath() (string, error)
|
2022-08-19 09:12:34 +00:00
|
|
|
GetLicenseFilePath() string
|
|
|
|
GetDependencyLicensesLink() string
|
2022-10-13 01:26:31 +00:00
|
|
|
Clear() error
|
2020-05-25 13:34:18 +00:00
|
|
|
}
|
|
|
|
|
2022-08-26 15:00:21 +00:00
|
|
|
type Identifier interface {
|
|
|
|
GetUserAgent() string
|
|
|
|
HasClient() bool
|
|
|
|
SetClient(name, version string)
|
|
|
|
SetPlatform(platform string)
|
2020-05-25 13:34:18 +00:00
|
|
|
}
|
|
|
|
|
2022-10-09 21:05:52 +00:00
|
|
|
type ProxyController interface {
|
2022-08-26 15:00:21 +00:00
|
|
|
AllowProxy()
|
|
|
|
DisallowProxy()
|
2020-05-25 13:34:18 +00:00
|
|
|
}
|
2021-01-27 08:16:04 +00:00
|
|
|
|
2022-10-09 21:05:52 +00:00
|
|
|
type TLSReporter interface {
|
|
|
|
GetTLSIssueCh() <-chan struct{}
|
|
|
|
}
|
|
|
|
|
2022-08-26 15:00:21 +00:00
|
|
|
type Autostarter interface {
|
|
|
|
Enable() error
|
|
|
|
Disable() error
|
2022-12-19 08:29:57 +00:00
|
|
|
IsEnabled() bool
|
2021-01-27 08:16:04 +00:00
|
|
|
}
|
|
|
|
|
2022-08-26 15:00:21 +00:00
|
|
|
type Updater interface {
|
2022-11-01 20:44:09 +00:00
|
|
|
GetVersionInfo(context.Context, updater.Downloader, updater.Channel) (updater.VersionInfo, error)
|
|
|
|
InstallUpdate(context.Context, updater.Downloader, updater.VersionInfo) error
|
2021-01-27 08:16:04 +00:00
|
|
|
}
|