mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-17 23:56:56 +00:00
feat(BRIDGE-363): Observability metrics for IMAP connections; minor unleash service refactor;
This commit is contained in:
@ -37,15 +37,29 @@ var pollJitter = 2 * time.Minute //nolint:gochecknoglobals
|
||||
const filename = "unleash_flags"
|
||||
|
||||
const (
|
||||
EventLoopNotificationDisabled = "InboxBridgeEventLoopNotificationDisabled"
|
||||
IMAPAuthenticateCommandDisabled = "InboxBridgeImapAuthenticateCommandDisabled"
|
||||
UserRemovalGluonDataCleanupDisabled = "InboxBridgeUserRemovalGluonDataCleanupDisabled"
|
||||
UpdateUseNewVersionFileStructureDisabled = "InboxBridgeUpdateWithOsFilterDisabled"
|
||||
EventLoopNotificationDisabled = "InboxBridgeEventLoopNotificationDisabled"
|
||||
IMAPAuthenticateCommandDisabled = "InboxBridgeImapAuthenticateCommandDisabled"
|
||||
UserRemovalGluonDataCleanupDisabled = "InboxBridgeUserRemovalGluonDataCleanupDisabled"
|
||||
UpdateUseNewVersionFileStructureDisabled = "InboxBridgeUpdateWithOsFilterDisabled"
|
||||
SMTPSubmissionRequestSentryReportDisabled = "InboxBridgeSmtpSubmissionRequestSentryReportDisabled"
|
||||
)
|
||||
|
||||
type requestFeaturesFn func(ctx context.Context) (proton.FeatureFlagResult, error)
|
||||
type GetFlagValueFn func(key string) bool
|
||||
type FeatureFlagValueProvider interface {
|
||||
GetFlagValue(key string) bool
|
||||
}
|
||||
|
||||
// NullUnleashService - mock of the unleash service. Should be used for testing.
|
||||
type NullUnleashService struct{}
|
||||
|
||||
func (n NullUnleashService) GetFlagValue(_ string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func NewNullUnleashService() *NullUnleashService {
|
||||
return &NullUnleashService{}
|
||||
}
|
||||
|
||||
type requestFeaturesFn func(ctx context.Context) (proton.FeatureFlagResult, error)
|
||||
type Service struct {
|
||||
panicHandler async.PanicHandler
|
||||
timer *proton.Ticker
|
||||
|
||||
Reference in New Issue
Block a user